From 38366e45dbc029d95770c1167ef9dd635650ecca Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Thu, 30 Dec 2021 13:14:54 -0500 Subject: [PATCH] fix(editor): Fix vim mode quit and add "wq" This changes `:q` to be quit (w/o saving) and added `:wq` to save *and* close. --- src/ScriptEditor/ui/ScriptEditorRoot.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index b2cc86304..944d65943 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -178,7 +178,12 @@ export function Root(props: IProps): React.ReactElement { save(); }); MonacoVim.VimMode.Vim.defineEx("quit", "q", function () { + props.router.toTerminal(); + }); + // "wqriteandquit" is not a typo, prefix must be found in full string + MonacoVim.VimMode.Vim.defineEx("wqriteandquit", "wq", function () { save(); + props.router.toTerminal(); }); editor.focus(); });