tvi: update cursor column after vi_wait() - neatvi - [fork] simple vi-type editor with UTF-8 support
(HTM) git clone git://src.adamsgaard.dk/neatvi
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 896da02715d68d3031e31e3862ac249e4ce4e645
(DIR) parent 5ed4bbc7f12686bb480ab8b2b05c94e12b1c71d8
(HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Thu, 26 Oct 2017 15:28:02 +0330
vi: update cursor column after vi_wait()
Diffstat:
M vi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/vi.c b/vi.c
t@@ -140,7 +140,9 @@ char *ex_read(char *msg)
struct sbuf *sb;
char c;
if (xled) {
+ int oleft = xleft;
char *s = led_prompt(msg, "", &xkmap);
+ xleft = oleft;
if (s)
term_chr('\n');
return s;
t@@ -1049,7 +1051,7 @@ static void vi(void)
vi_drawagain(xcol, 0);
term_pos(xrow - xtop, led_pos(lbuf_get(xb, xrow), xcol));
while (!xquit) {
- int mod = 0; /* screen should be redrawn (1: current line, 2: the whole screen */
+ int mod = 0; /* screen should be redrawn (1: the whole screen, 2: the current line) */
int nrow = xrow;
int noff = ren_noeol(lbuf_get(xb, xrow), xoff);
int otop = xtop;
t@@ -1237,7 +1239,7 @@ static void vi(void)
k = vi_read();
if (k == '~' || k == 'u' || k == 'U')
if (!vc_motion(k))
- mod = 1;
+ mod = 2;
if (k == 'a')
vc_charinfo();
break;