tvi: clear the status line when redrawing - neatvi - [fork] simple vi-type edit… | |
git clone git://src.adamsgaard.dk/neatvi | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 0a858aba4cababc83b862da41aa8c8c07a564ea9 | |
parent 3a7a3bacd46ef3477daae02cddff1c18bf0a2658 | |
Author: Ali Gholami Rudi <[email protected]> | |
Date: Tue, 12 May 2015 16:41:31 +0430 | |
vi: clear the status line when redrawing | |
Diffstat: | |
M vi.c | 10 ++++++++-- | |
1 file changed, 8 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/vi.c b/vi.c | |
t@@ -27,6 +27,7 @@ static void vi_draw(void) | |
char *s = lbuf_get(xb, i); | |
led_print(s ? s : "~", i - xtop); | |
} | |
+ led_print("", xrows); | |
term_pos(xrow, led_pos(lbuf_get(xb, i), xcol)); | |
term_commit(); | |
} | |
t@@ -613,6 +614,7 @@ static void vc_join(int arg) | |
static void vi(void) | |
{ | |
int mark; | |
+ char *ln; | |
term_init(); | |
xtop = 0; | |
xrow = 0; | |
t@@ -663,10 +665,14 @@ static void vi(void) | |
case ':': | |
term_pos(xrows, led_pos(":", 0)); | |
term_kill(); | |
- ex_command(NULL); | |
+ ln = led_prompt(":", ""); | |
+ if (ln && ln[0]) { | |
+ ex_command(ln); | |
+ redraw = 1; | |
+ } | |
+ free(ln); | |
if (xquit) | |
continue; | |
- redraw = 1; | |
break; | |
case 'c': | |
case 'd': |