diff options
author | Zankio | 2016-04-23 23:26:40 +0800 |
---|---|---|
committer | Zankio | 2016-04-23 23:35:23 +0800 |
commit | 3aa9204e574c84962806acf271396c095eda8e2b (patch) | |
tree | 93a6aec6c28c515400ea7eb03a678bcca0b302ca /public | |
parent | 14c6778715a1f01e73bf4bed056ee66f5aea4f60 (diff) |
Fix Esc in Vim mode
Diffstat (limited to '')
-rw-r--r-- | public/js/index.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/public/js/index.js b/public/js/index.js index f38e2baf..26c1ed6a 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -5,13 +5,14 @@ var defaultExtraKeys = { cm.setOption("fullScreen", !cm.getOption("fullScreen")); }, "Esc": function(cm) { - if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); + if (cm.getOption('keyMap').substr(0, 3) === 'vim') return CodeMirror.Pass; + else if(cm.getOption("fullScreen")) cm.setOption("fullScreen", false); }, "Cmd-S": function () { - return CodeMirror.PASS + return CodeMirror.Pass }, "Ctrl-S": function () { - return CodeMirror.PASS + return CodeMirror.Pass }, "Enter": "newlineAndIndentContinueMarkdownList", "Tab": function(cm) { @@ -2928,4 +2929,4 @@ $(editor.getInputField()) $(this).data('autocompleting', false); editor.setOption("extraKeys", defaultExtraKeys); } - });
\ No newline at end of file + }); |