Skip to content

Commit

Permalink
[python mode] Return to parent indentation level when scope is closed.
Browse files Browse the repository at this point in the history
This makes it work correctly when the hanging indent is different from the indent unit.
  • Loading branch information
mtaran-google authored and marijnh committed Jun 23, 2014
1 parent b1a256b commit 9d02d3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mode/python/python.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,10 @@
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: "#",
Expand Down

0 comments on commit 9d02d3a

Please sign in to comment.