diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-05-06 08:00:06 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-05-06 08:00:06 -0700 |
commit | 1965dfa1525950cf4efc96a16613734d65ea0dc0 (patch) | |
tree | d7502f0e4c5d88f2865278885fa0913f4d3cc07a | |
parent | e04b04fe0d32c914d962d2e5c2a553131f21ceaf (diff) | |
download | pw-1965dfa1525950cf4efc96a16613734d65ea0dc0.tar.gz pw-1965dfa1525950cf4efc96a16613734d65ea0dc0.tar.bz2 pw-1965dfa1525950cf4efc96a16613734d65ea0dc0.zip |
New { } commands to reposition middle pane origin.
-rw-r--r-- | pw.1 | 14 | ||||
-rw-r--r-- | pw.c | 12 |
2 files changed, 26 insertions, 0 deletions
@@ -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 @@ -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; |