From decbdd98c3571a5fdbc34f918d392ffcc33a9c03 Mon Sep 17 00:00:00 2001 From: rapster Date: Thu, 2 Jun 2016 16:37:20 +0000 Subject: [PATCH] codemirror: New codemirrorParam 'jumpToLine_extraKey'. Forum #54112 git-svn-id: https://svn.fhem.de/fhem/trunk@11596 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/www/codemirror/fhem_codemirror.js | 36 ++++++++++++++------------ 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/fhem/www/codemirror/fhem_codemirror.js b/fhem/www/codemirror/fhem_codemirror.js index a399952b5..3961ddb63 100644 --- a/fhem/www/codemirror/fhem_codemirror.js +++ b/fhem/www/codemirror/fhem_codemirror.js @@ -3,22 +3,23 @@ var cm_loaded = 0; var cm_active = 0; var cm_attr = { - matchBrackets: true, - autoRefresh: true, - search: true, - comment: true, - autocomplete: true, - autocompleteAlways: false, - autoCloseBrackets: true, - indentUnit: 4, - type: "fhem", - theme: "blackboard", - indentWithTabs: true, - autofocus: true, - lineNumbers: true, - jumpToLine: false, - smartIndent: false, - height: false, + matchBrackets: true, + autoRefresh: true, + search: true, + comment: true, + autocomplete: true, + autocompleteAlways: false, + autoCloseBrackets: true, + indentUnit: 4, + type: "fhem", + theme: "blackboard", + indentWithTabs: true, + autofocus: true, + lineNumbers: true, + jumpToLine: false, + jumpToLine_extraKey: false, + smartIndent: false, + height: false, extraKeys: { 'Tab': function(cm) { if (cm.somethingSelected()) { @@ -98,6 +99,9 @@ function AddCodeMirror(e, cb) { } if (cm_attr.jumpToLine) { cm_active++; loadScript("codemirror/jump-to-line.js", function(){cm_loaded++;} ); + if (cm_attr.jumpToLine_extraKey) { + cm_attr.extraKeys[cm_attr.jumpToLine_extraKey] = 'jumpToLine'; + } } // editor user preferences