Просмотр исходного кода

Merge branch 'main' of github.com:overleaf/internal

GitOrigin-RevId: b0a13b4b4f7ede46d5ac5478dd03642d59e11a98
Christopher Hoskin 3 лет назад
Родитель
Сommit
5bbe427ed0
1 измененных файлов с 16 добавлено и 1 удалено
  1. 16 1
      services/web/frontend/js/features/source-editor/extensions/keybindings.ts

+ 16 - 1
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) {
   Vim.defineAction('unfoldCode', function (cm: CodeMirror) {
     unfoldCode(cm.cm6)
     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('<Tab>', undefined, undefined, undefined, {
+    context: 'normal',
+  })
+  Vim.mapCommand('<Tab>', undefined, undefined, undefined, {
+    context: 'visual',
+  })
+  Vim.mapCommand('<S-Tab>', undefined, undefined, undefined, {
+    context: 'normal',
+  })
+  Vim.mapCommand('<S-Tab>', undefined, undefined, undefined, {
+    context: 'visual',
+  })
 
 
   // Make the Vim 'write' command start a compile
   // Make the Vim 'write' command start a compile
   CodeMirror.commands.save = () => {
   CodeMirror.commands.save = () => {