Commit f2fd7c85 authored by Jérome Perrin's avatar Jérome Perrin

erp5_code_mirror: do not insert tab when hitting tab

parent c20a55d4
...@@ -360,7 +360,7 @@ ...@@ -360,7 +360,7 @@
else if(element.webkitRequestFullScreen) {\n else if(element.webkitRequestFullScreen) {\n
element.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);\n element.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);\n
}\n }\n
\n \n
cm.refresh();\n cm.refresh();\n
}\n }\n
}\n }\n
...@@ -485,6 +485,14 @@ ...@@ -485,6 +485,14 @@
matchBrackets: true,\n matchBrackets: true,\n
extraKeys: {"Ctrl-Space": "autocomplete",\n extraKeys: {"Ctrl-Space": "autocomplete",\n
"Ctrl-Q": function(cm){cm.foldCode(cm.getCursor());},\n "Ctrl-Q": function(cm){cm.foldCode(cm.getCursor());},\n
"Tab": function(cm) {\n
// We want to insert spaces, not tab, and we also want to keep the behaviour of indenting selection.\n
if (cm.getSelection()) {\n
return cm.execCommand("defaultTab");\n
}\n
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");\n
cm.replaceSelection(spaces);\n
},\n
"Ctrl-S": function(cm){saveDocument(cm, $.Event(\'click\'))}},\n "Ctrl-S": function(cm){saveDocument(cm, $.Event(\'click\'))}},\n
foldGutter: true,\n foldGutter: true,\n
lineWrapping: true,\n lineWrapping: true,\n
......
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