Skip to content
Snippets Groups Projects
Commit 065dcacd authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

make sure Python parser doesn't pop off its last scope obj

parent c90c4c57
No related branches found
No related tags found
No related merge requests found
......@@ -196,6 +196,7 @@ CodeMirror.defineMode("python", function(conf) {
}
function dedent(stream, state) {
if (state.scopes.length == 1) return;
if (state.scopes[0].type === 'py') {
var _indent = stream.indentation();
var _indent_index = -1;
......@@ -270,7 +271,7 @@ CodeMirror.defineMode("python", function(conf) {
}
}
if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'py') {
state.scopes.shift();
if (state.scopes.length > 1) state.scopes.shift();
state.dedent -= 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment