Fix #4487: Outdentation bug (#4488)

This commit is contained in:
Julian Rosse
2017-04-08 16:12:55 -04:00
committed by Geoffrey Booth
parent b192e215a5
commit 76945ab458
3 changed files with 23 additions and 12 deletions

View File

@@ -414,12 +414,9 @@ exports.Lexer = class Lexer
lastIndent = @indents[@indents.length - 1]
if not lastIndent
moveOut = 0
else if lastIndent is @outdebt
moveOut -= @outdebt
@outdebt = 0
else if lastIndent < @outdebt
@outdebt -= lastIndent
moveOut -= lastIndent
else if @outdebt and moveOut <= @outdebt
@outdebt -= moveOut
moveOut = 0
else
dent = @indents.pop() + @outdebt
if outdentLength and @chunk[outdentLength] in INDENTABLE_CLOSERS