summaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 4257c0fdc..6fa0a4e18 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -1217,10 +1217,11 @@ static char *get_input_line(const char *prompt)
break; // this is end of input
if (isbackspace(c)) {
// user wants to erase prev char
- write1("\b \b"); // erase char on screen
buf[--i] = '\0';
+ go_bottom_and_clear_to_eol();
if (i <= 0) // user backs up before b-o-l, exit
break;
+ write1(buf);
} else if (c > 0 && c < 256) { // exclude Unicode
// (TODO: need to handle Unicode)
buf[i] = c;