Commit 7480d157 authored by Klaus Wölfel's avatar Klaus Wölfel

Chromium/NayuOS compatibility for code mirror key bindings

Change autocomplete from Ctrl-Space to Alt-Space, because
the former is already used for switching keyboard language.

Change indent less from Ctrl-] to Shift-Tab, because the
former is already used for switching between browser tabs.

@nexedi any objections ?

/reviewed-on nexedi/erp5!213
parent 838b7375
...@@ -491,6 +491,7 @@ ...@@ -491,6 +491,7 @@
indentWithTabs: false, indentWithTabs: false,
matchBrackets: true, matchBrackets: true,
extraKeys: {"Ctrl-Space": "autocomplete", extraKeys: {"Ctrl-Space": "autocomplete",
"Alt-Space": "autocomplete",
"Ctrl-Q": function(cm){cm.foldCode(cm.getCursor());}, "Ctrl-Q": function(cm){cm.foldCode(cm.getCursor());},
"Tab": function(cm) { "Tab": function(cm) {
// We want to insert spaces, not tab, and we also want to keep the behaviour of indenting selection. // We want to insert spaces, not tab, and we also want to keep the behaviour of indenting selection.
...@@ -500,6 +501,8 @@ ...@@ -500,6 +501,8 @@
var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
cm.replaceSelection(spaces); cm.replaceSelection(spaces);
}, },
"Ctrl-I": "indentAuto",
"Shift-Tab": "indentLess",
"Ctrl-S": function(cm){saveDocument(cm, $.Event('click'))}}, "Ctrl-S": function(cm){saveDocument(cm, $.Event('click'))}},
foldGutter: true, foldGutter: true,
lineWrapping: true, lineWrapping: true,
...@@ -703,3 +706,4 @@ ...@@ -703,3 +706,4 @@
generateHistorySelectElement(); generateHistorySelectElement();
</dtml-unless> </dtml-unless>
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment