[git commit] vi: support more commands for range selection
Denys Vlasenko
vda.linux at googlemail.com
Mon Mar 29 10:16:21 UTC 2021
commit: https://git.busybox.net/busybox/commit/?id=d4c46037a6c595c42aab22b6910c56f5ccadb96e
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
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 at pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
editors/vi.c | 6 +++---
1 file 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)
buftype = WHOLE;
if (--cmdcnt > 0)
do_cmd('j');
- } else if (strchr("^%$0bBeEfth\b\177", c)) {
+ } else if (strchr("^%$0bBeEfFtTh|\b\177", c)) {
// These cmds operate on char positions
buftype = PARTIAL;
do_cmd(c); // execute movement cmd
@@ -3090,8 +3090,8 @@ static int find_range(char **start, char **stop, char c)
q = end_line(q);
}
- // backward char movements don't include start position
- if (q > p && strchr("^0bBh\b\177", c)) q--;
+ // movements which don't include end of range
+ if (q > p && strchr("^0bBFTh|\b\177", c)) q--;
*start = p;
*stop = q;
More information about the busybox-cvs
mailing list