diff options
author | Sheogorath | 2018-02-24 21:03:12 +0100 |
---|---|---|
committer | Sheogorath | 2018-02-24 21:14:47 +0100 |
commit | 9c77e9d7f0fbf48d8f8462b0020801c7878d1901 (patch) | |
tree | eeea50d23421627116962b69623f3aaa11b32bfa /public/js | |
parent | 6bcc72e09004a6f350005809008c3ecf14d45c41 (diff) |
Allow the usage of the esc-key by codemirror
This change allows all input modes of codemirror to use the information
from an input esc-key and make this way vim and sublime more
functional. To prevent this change from breaking the return from the
fullscreen mode, it catches the esc-key in this case. Hopefully this is
an acceptable solution.
As before the vim-mode is handled different in fulltext-mode as it is
esc-key heavy.
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/lib/editor/index.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/public/js/lib/editor/index.js b/public/js/lib/editor/index.js index 003b32b7..bc228b7b 100644 --- a/public/js/lib/editor/index.js +++ b/public/js/lib/editor/index.js @@ -18,10 +18,10 @@ export default class Editor { cm.setOption('fullScreen', !cm.getOption('fullScreen')) }, Esc: function (cm) { - if (cm.getOption('keyMap').substr(0, 3) === 'vim') { - return CodeMirror.Pass - } else if (cm.getOption('fullScreen')) { + if (cm.getOption('fullScreen') && !(cm.getOption('keyMap').substr(0, 3) === 'vim')) { cm.setOption('fullScreen', false) + } else { + return CodeMirror.Pass } }, 'Cmd-S': function () { |