aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-05-06 08:00:06 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-05-06 08:00:06 -0700
commit1965dfa1525950cf4efc96a16613734d65ea0dc0 (patch)
treed7502f0e4c5d88f2865278885fa0913f4d3cc07a
parente04b04fe0d32c914d962d2e5c2a553131f21ceaf (diff)
downloadpw-1965dfa1525950cf4efc96a16613734d65ea0dc0.tar.gz
pw-1965dfa1525950cf4efc96a16613734d65ea0dc0.tar.bz2
pw-1965dfa1525950cf4efc96a16613734d65ea0dc0.zip
New { } commands to reposition middle pane origin.
-rw-r--r--pw.114
-rw-r--r--pw.c12
2 files changed, 26 insertions, 0 deletions
diff --git a/pw.1 b/pw.1
index d12b4a9..e043e0b 100644
--- a/pw.1
+++ b/pw.1
@@ -214,6 +214,20 @@ can be adjusted without affecting what portion of the line it shows,
independently of any horizontal scrolling adjustments occurring in the right
pane.
+.IP "[\fIcount\fP]\fB{\fP, [\fIcount\fP]\fB}\fP"
+Adjust what portion of line is visible in the middle pane, incrementing
+or decrementing the viewport origin by
+.I count
+characters, defaulting to one, without changing the width.
+The effect is that the content of the middle pane appears to
+scroll horizontally to the right when
+.B }
+is used, or left when
+.B {
+is used.
+When no middle pane is being shown, these commands have no effect other
+than refreshing the display.
+
.IP "\fBCtrl-I, Tab\fP"
Toggle the highlighting of separator characters appearing in the line
display. The when toggled on, the
diff --git a/pw.c b/pw.c
index 41c8516..3bd77fe 100644
--- a/pw.c
+++ b/pw.c
@@ -1233,6 +1233,18 @@ int main(int argc, char **argv)
pw.vsplit2 = max(0, pw.vsplit2 - (int) cmdcount);
pw.stat |= stat_force;
break;
+ case '}':
+ if (cmdcount == UINT_MAX)
+ cmdcount = 1;
+ pw.vs2pos = min((int) maxlen, pw.vs2pos + (int) cmdcount);
+ pw.stat |= stat_force;
+ break;
+ case '{':
+ if (cmdcount == UINT_MAX)
+ cmdcount = 1;
+ pw.vs2pos = max(0, pw.vs2pos - (int) cmdcount);
+ pw.stat |= stat_force;
+ break;
case ctrl('i'):
pw.stat ^= stat_hlite;
pw.stat |= stat_force;