diff options
author | June McEnroe <june@causal.agency> | 2022-03-12 16:25:02 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2022-03-12 16:25:02 -0500 |
commit | a1340f1d434c8ae3bb41b529b3bef6e641298096 (patch) | |
tree | f0219cca603f47f50fee2e296e1e9ac63ae76ea8 | |
parent | Add edit option to set line editing mode (diff) | |
download | catgirl-a1340f1d434c8ae3bb41b529b3bef6e641298096.tar.gz catgirl-a1340f1d434c8ae3bb41b529b3bef6e641298096.zip |
Call editVi from input.c
-rw-r--r-- | input.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/input.c b/input.c index 889bde7..abfc421 100644 --- a/input.c +++ b/input.c @@ -499,6 +499,7 @@ static void keyCtrl(wchar_t ch) { break; case L'S': windowSearch(editString(edit, &buf, &cap, NULL), +1); break; case L'V': windowScroll(ScrollPage, -1); break; case L'X': error = macroExpand(edit); tabAccept(); + break; default: if (inputMode == InputVi) error = editVi(edit, ch); } if (error) err(EX_OSERR, "editFn"); } @@ -586,9 +587,12 @@ void inputRead(void) { } else if (iswcntrl(ch)) { tabbing = (ch == (L'I' ^ L'@')); keyCtrl(ch); - } else { + } else if (inputMode == InputEmacs) { int error = editInsert(&edits[windowID()], ch); if (error) err(EX_OSERR, "editInsert"); + } else if (inputMode == InputVi) { + int error = editVi(&edits[windowID()], ch); + if (error) err(EX_OSERR, "editVi"); } style = false; literal = false; |