Commit 208417cd authored by Jérome Perrin's avatar Jérome Perrin

codemirror: define `hanging_indent: 4` for python

to match what yapf is doing
parent e37edff6
......@@ -240,7 +240,7 @@
generateHistorySelectElement();
/* check getTextContent have not changed server side (for example YAPF) */
if (mode == 'python') {
if (mode === 'python' || (mode && mode.name === 'python')) {
$.ajax({
type: 'GET',
url: 'getTextContent',
......@@ -347,7 +347,7 @@
function saveZMIDocument(cm, event) {
/* preformat with YAPF before saving */
if (mode == 'python') {
if (mode === 'python' || (mode && mode.name === 'python')) {
$.ajax({
type: 'POST',
url: '&dtml-portal_url;/ERP5Site_formatPythonSourceCode',
......@@ -514,6 +514,10 @@
<dtml-if expr="mode == 'python'">
lint_option = {"getAnnotations": checkPythonSourceCode,
"async": true};
mode = {
name: "python",
hangingIndent: 4
}
<dtml-elif expr="mode in ('css', 'javascript')">
lint_option = true;
<dtml-else>
......
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