aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-02-05 11:24:06 +0000
committerRon Yorston <rmy@pobox.com>2021-02-05 11:24:06 +0000
commit32e19e7ae8b0d76d69871ba234e8f0af31baff4e (patch)
tree6fdc833a444e0dd6fd359b21a8d463856917a387 /editors/vi.c
parent4fb71406b884c6ac0a9a4d2acf7a32b544611f70 (diff)
parentcad3fc743aa7c7744e4fcf044371f0fda50fa51f (diff)
downloadbusybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.tar.gz
busybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.tar.bz2
busybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/editors/vi.c b/editors/vi.c
index bfe05d613..8181a5384 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -524,7 +524,7 @@ static void show_help(void)
524 524
525static void write1(const char *out) 525static void write1(const char *out)
526{ 526{
527 fputs(out, stdout); 527 fputs_stdout(out);
528} 528}
529 529
530#if ENABLE_FEATURE_VI_WIN_RESIZE 530#if ENABLE_FEATURE_VI_WIN_RESIZE
@@ -3113,12 +3113,15 @@ static int find_range(char **start, char **stop, char c)
3113 do_cmd(c); // execute movement cmd 3113 do_cmd(c); // execute movement cmd
3114 dot_end(); // find NL 3114 dot_end(); // find NL
3115 q = dot; 3115 q = dot;
3116 } else { 3116 } else /* if (c == ' ' || c == 'l') */ {
3117 // nothing -- this causes any other values of c to 3117 // forward motion by character
3118 // represent the one-character range under the 3118 int tmpcnt = (cmdcnt ?: 1);
3119 // cursor. this is correct for ' ' and 'l', but 3119 do_cmd(c); // execute movement cmd
3120 // perhaps no others. 3120 // exclude last char unless range isn't what we expected
3121 // 3121 // this indicates we've hit EOL
3122 if (tmpcnt == dot - p)
3123 dot--;
3124 q = dot;
3122 } 3125 }
3123 if (q < p) { 3126 if (q < p) {
3124 t = q; 3127 t = q;