summaryrefslogtreecommitdiff
path: root/public/js/lib
diff options
context:
space:
mode:
authorSheogorath2018-02-24 21:03:12 +0100
committerSheogorath2018-02-24 21:14:47 +0100
commit9c77e9d7f0fbf48d8f8462b0020801c7878d1901 (patch)
treeeeea50d23421627116962b69623f3aaa11b32bfa /public/js/lib
parent6bcc72e09004a6f350005809008c3ecf14d45c41 (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/lib')
-rw-r--r--public/js/lib/editor/index.js6
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 () {