From b1c29ac88c09f3233ee8c058ec48ffb5022d964f Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Wed, 10 May 2023 16:10:07 +0000 Subject: [PATCH] codemirror: improve code folding (hotkeys) git-svn-id: https://svn.fhem.de/fhem/trunk@27547 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/www/codemirror/fhem_codemirror.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fhem/www/codemirror/fhem_codemirror.js b/fhem/www/codemirror/fhem_codemirror.js index 1d4084b59..bee87fde4 100644 --- a/fhem/www/codemirror/fhem_codemirror.js +++ b/fhem/www/codemirror/fhem_codemirror.js @@ -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"];