From f651aa9ff6103e05ea0e4146a426bbbc1de61d19 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Fri, 19 May 2023 09:29:27 +0100 Subject: [PATCH] Merge branch 'main' of github.com:overleaf/internal GitOrigin-RevId: b0a13b4b4f7ede46d5ac5478dd03642d59e11a98 --- .../source-editor/extensions/keybindings.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/source-editor/extensions/keybindings.ts b/services/web/frontend/js/features/source-editor/extensions/keybindings.ts index 6139b77bba..c2f8a62169 100644 --- a/services/web/frontend/js/features/source-editor/extensions/keybindings.ts +++ b/services/web/frontend/js/features/source-editor/extensions/keybindings.ts @@ -85,7 +85,22 @@ const customiseVimOnce = (Vim: any, CodeMirror: any) => { Vim.defineAction('unfoldCode', function (cm: CodeMirror) { unfoldCode(cm.cm6) }) - Vim.mapCommand('zo', 'action', 'unfoldCode') + + // disable tab and shift-tab keys in command (normal) and visual modes + // using "undefined" params because mapCommand signature is: + // mapCommand(keys, type, name, args, extra) + Vim.mapCommand('', undefined, undefined, undefined, { + context: 'normal', + }) + Vim.mapCommand('', undefined, undefined, undefined, { + context: 'visual', + }) + Vim.mapCommand('', undefined, undefined, undefined, { + context: 'normal', + }) + Vim.mapCommand('', undefined, undefined, undefined, { + context: 'visual', + }) // Make the Vim 'write' command start a compile CodeMirror.commands.save = () => {