Skip to content

Commit 9c77e9d

Browse files
committed
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>
1 parent 6bcc72e commit 9c77e9d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

public/js/lib/editor/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export default class Editor {
1818
cm.setOption('fullScreen', !cm.getOption('fullScreen'))
1919
},
2020
Esc: function (cm) {
21-
if (cm.getOption('keyMap').substr(0, 3) === 'vim') {
22-
return CodeMirror.Pass
23-
} else if (cm.getOption('fullScreen')) {
21+
if (cm.getOption('fullScreen') && !(cm.getOption('keyMap').substr(0, 3) === 'vim')) {
2422
cm.setOption('fullScreen', false)
23+
} else {
24+
return CodeMirror.Pass
2525
}
2626
},
2727
'Cmd-S': function () {

0 commit comments

Comments
 (0)