fixed codemirror syntax highlighting, thanks Mariano

This commit is contained in:
mdipierro
2013-01-27 09:59:19 -06:00
parent ec7c8f0248
commit 8fe3934c6e
3 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -645,6 +645,7 @@ def edit():
code = request.vars.data.rstrip().replace('\r\n', '\n') + '\n'
compile(code, path, "exec", _ast.PyCF_ONLY_AST)
except Exception, e:
# offset calculation is only used for textarea (start/stop)
start = sum([len(line) + 1 for l, line
in enumerate(request.vars.data.split("\n"))
if l < e.lineno - 1])
@@ -654,7 +655,7 @@ def edit():
else:
offset = 0
highlight = {'start': start, 'end': start +
offset + 1, 'lineno': e.lineno}
offset + 1, 'lineno': e.lineno, 'offset': offset}
try:
ex_name = e.__class__.__name__
except: