Adds r command to replace a char
This commit is contained in:
parent
ea1bf315fd
commit
8447b76e1a
|
@ -1,3 +1,4 @@
|
||||||
hermes
|
hermes
|
||||||
*.txt
|
*.txt
|
||||||
test*
|
test*
|
||||||
|
*.1.gz
|
||||||
|
|
13
hermes.c
13
hermes.c
|
@ -1109,6 +1109,19 @@ void editorCommandKp(int c) {
|
||||||
case '\033':
|
case '\033':
|
||||||
if (E.mode == VisualMode) E.mode = CommandMode;
|
if (E.mode == VisualMode) E.mode = CommandMode;
|
||||||
break;
|
break;
|
||||||
|
case 'r':
|
||||||
|
{
|
||||||
|
int c = editorReadKey();
|
||||||
|
if (c) {
|
||||||
|
E.mode = InputMode;
|
||||||
|
editorMoveCursor(ARROW_RIGHT);
|
||||||
|
editorDeleteChar();
|
||||||
|
editorInputKp(c);
|
||||||
|
E.mode = CommandMode;
|
||||||
|
editorMoveCursor(ARROW_LEFT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
if (deleting) {
|
if (deleting) {
|
||||||
int totlen = 0;
|
int totlen = 0;
|
||||||
|
|
Loading…
Reference in New Issue