vi: make BACKSPACE and DELETE join lines at start/end of line
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
8ec1ff350c
commit
49acc1a761
@ -2017,8 +2017,7 @@ static char *char_insert(char *p, char c, int undo) // insert the char c at 'p'
|
|||||||
p--;
|
p--;
|
||||||
}
|
}
|
||||||
} else if (c == erase_char || c == 8 || c == 127) { // Is this a BS
|
} else if (c == erase_char || c == 8 || c == 127) { // Is this a BS
|
||||||
// 123456789
|
if (p > text) {
|
||||||
if ((p[-1] != '\n') && (dot>text)) {
|
|
||||||
p--;
|
p--;
|
||||||
p = text_hole_delete(p, p, ALLOW_UNDO_QUEUED); // shrink buffer 1 char
|
p = text_hole_delete(p, p, ALLOW_UNDO_QUEUED); // shrink buffer 1 char
|
||||||
}
|
}
|
||||||
@ -4026,8 +4025,9 @@ static void do_cmd(int c)
|
|||||||
undo_queue_commit();
|
undo_queue_commit();
|
||||||
break;
|
break;
|
||||||
case KEYCODE_DELETE:
|
case KEYCODE_DELETE:
|
||||||
c = 'x';
|
if (dot < end - 1)
|
||||||
// fall through
|
dot = yank_delete(dot, dot, 1, YANKDEL, ALLOW_UNDO);
|
||||||
|
break;
|
||||||
case 'X': // X- delete char before dot
|
case 'X': // X- delete char before dot
|
||||||
case 'x': // x- delete the current char
|
case 'x': // x- delete the current char
|
||||||
case 's': // s- substitute the current char
|
case 's': // s- substitute the current char
|
||||||
|
Loading…
Reference in New Issue
Block a user