aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-03-28 13:21:08 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2021-03-29 12:16:21 +0200
commitd4c46037a6c595c42aab22b6910c56f5ccadb96e (patch)
tree5bec2722c5b24c5721d8d69955ed1b5401adc2d8
parent15f4ac3ca99bca8811a334f9c7603969ab7ad362 (diff)
downloadbusybox-w32-d4c46037a6c595c42aab22b6910c56f5ccadb96e.tar.gz
busybox-w32-d4c46037a6c595c42aab22b6910c56f5ccadb96e.tar.bz2
busybox-w32-d4c46037a6c595c42aab22b6910c56f5ccadb96e.zip
vi: support more commands for range selection
Add 'F', 'T' and '|' as commands that can be used to specify a range for change/delete/yank operations. function old new delta .rodata 105129 105135 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 6/0) Total: 6 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/vi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/editors/vi.c b/editors/vi.c
index ec2d64dfb..5d96c1575 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -3048,7 +3048,7 @@ static int find_range(char **start, char **stop, char c)
3048 buftype = WHOLE; 3048 buftype = WHOLE;
3049 if (--cmdcnt > 0) 3049 if (--cmdcnt > 0)
3050 do_cmd('j'); 3050 do_cmd('j');
3051 } else if (strchr("^%$0bBeEfth\b\177", c)) { 3051 } else if (strchr("^%$0bBeEfFtTh|\b\177", c)) {
3052 // These cmds operate on char positions 3052 // These cmds operate on char positions
3053 buftype = PARTIAL; 3053 buftype = PARTIAL;
3054 do_cmd(c); // execute movement cmd 3054 do_cmd(c); // execute movement cmd
@@ -3090,8 +3090,8 @@ static int find_range(char **start, char **stop, char c)
3090 q = end_line(q); 3090 q = end_line(q);
3091 } 3091 }
3092 3092
3093 // backward char movements don't include start position 3093 // movements which don't include end of range
3094 if (q > p && strchr("^0bBh\b\177", c)) q--; 3094 if (q > p && strchr("^0bBFTh|\b\177", c)) q--;
3095 3095
3096 *start = p; 3096 *start = p;
3097 *stop = q; 3097 *stop = q;