2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

codemirror: improve code folding (hotkeys)

git-svn-id: https://svn.fhem.de/fhem/trunk@27547 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2023-05-10 16:10:07 +00:00
parent 7f2c2f6ee4
commit b1c29ac88c

View File

@ -86,7 +86,9 @@ function AddCodeMirror(e, cb) {
cm_active++;
loadLink("codemirror/foldgutter.css");
loadScript("codemirror/foldgutter.js", function(){cm_loaded++;} );
cm_attr.extraKeys['Ctrl-X'] = function(cm){ cm.foldCode(cm.getCursor()) };
cm_attr.extraKeys['Ctrl-X'] = function(cm){ cm.foldCode(cm.getCursor(),{ scanUp: true }); };
cm_attr.extraKeys['Ctrl-I'] = function(cm){ CodeMirror.commands.foldAll(cm); };
cm_attr.extraKeys['Ctrl-J'] = function(cm){ CodeMirror.commands.unfoldAll(cm); };
cm_active++; loadScript("codemirror/brace-fold.js", function(){cm_loaded++;} );
cm_active++; loadScript("codemirror/foldcode.js", function(){cm_loaded++;} );
cm_attr.gutters = ["CodeMirror-linenumbers", "CodeMirror-foldgutter"];