Skip to content

Commit e873e9d

Browse files
committed
[python mode] Make sure the base scope is never dropped
Closes codemirror#4105
1 parent b8c8a3e commit e873e9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mode/python/python.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233

234234
function dedent(stream, state) {
235235
var indented = stream.indentation();
236-
while (top(state).offset > indented) {
236+
while (state.scopes.length > 1 && top(state).offset > indented) {
237237
if (top(state).type != "py") return true;
238238
state.scopes.pop();
239239
}

0 commit comments

Comments
 (0)