vendor/assets/javascripts/codemirror/modes/python.js in codemirror-rails-4.2 vs vendor/assets/javascripts/codemirror/modes/python.js in codemirror-rails-4.3
- old
+ new
@@ -318,11 +318,13 @@
var scope = top(state);
var closing = textAfter && textAfter.charAt(0) == scope.type;
if (scope.align != null)
return scope.align - (closing ? 1 : 0);
+ else if (closing && state.scopes.length > 1)
+ return state.scopes[state.scopes.length - 2].offset;
else
- return scope.offset - (closing ? conf.indentUnit : 0);
+ return scope.offset;
},
lineComment: "#",
fold: "indent"
};