Adds r command to replace a char

This commit is contained in:
sloumdrone 2020-01-04 22:47:39 -08:00
parent ea1bf315fd
commit 8447b76e1a
2 changed files with 14 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
hermes
*.txt
test*
*.1.gz

View File

@ -1109,6 +1109,19 @@ void editorCommandKp(int c) {
case '\033':
if (E.mode == VisualMode) E.mode = CommandMode;
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':
if (deleting) {
int totlen = 0;