aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 1fa97b568..926aef19b 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2017,8 +2017,7 @@ static char *char_insert(char *p, char c, int undo) // insert the char c at 'p'
2017 p--; 2017 p--;
2018 } 2018 }
2019 } else if (c == erase_char || c == 8 || c == 127) { // Is this a BS 2019 } else if (c == erase_char || c == 8 || c == 127) { // Is this a BS
2020 // 123456789 2020 if (p > text) {
2021 if ((p[-1] != '\n') && (dot>text)) {
2022 p--; 2021 p--;
2023 p = text_hole_delete(p, p, ALLOW_UNDO_QUEUED); // shrink buffer 1 char 2022 p = text_hole_delete(p, p, ALLOW_UNDO_QUEUED); // shrink buffer 1 char
2024 } 2023 }
@@ -4073,8 +4072,9 @@ static void do_cmd(int c)
4073 undo_queue_commit(); 4072 undo_queue_commit();
4074 break; 4073 break;
4075 case KEYCODE_DELETE: 4074 case KEYCODE_DELETE:
4076 c = 'x'; 4075 if (dot < end - 1)
4077 // fall through 4076 dot = yank_delete(dot, dot, 1, YANKDEL, ALLOW_UNDO);
4077 break;
4078 case 'X': // X- delete char before dot 4078 case 'X': // X- delete char before dot
4079 case 'x': // x- delete the current char 4079 case 'x': // x- delete the current char
4080 case 's': // s- substitute the current char 4080 case 's': // s- substitute the current char