Show guide on soft wrapped lines with indentation

* Rename phantomToken to softWrapIndent and use it consistently
* Build multiple softWrapIndent tokens in order to show guides
* Memoize softWrapIndentTokens and softWrapIndentDelta
This commit is contained in:
Antonio Scandurra
2015-02-20 09:29:37 +01:00
parent 59cc10a1ee
commit ed77358515
4 changed files with 31 additions and 22 deletions

View File

@@ -844,7 +844,7 @@ class DisplayBuffer extends Model
column = @screenLines[row].clipScreenColumn(0)
else
column = screenLine.clipScreenColumn(maxScreenColumn - 1)
else if screenLine.isColumnInsidePhantomToken(column)
else if screenLine.isColumnInsideSoftWrapIndentation(column)
if wrapAtSoftNewlines
column = screenLine.clipScreenColumn(0)
else
@@ -1144,7 +1144,7 @@ class DisplayBuffer extends Model
if @isSoftWrapped()
while wrapScreenColumn = tokenizedLine.findWrapColumn(@getSoftWrapColumn())
[wrappedLine, tokenizedLine] = tokenizedLine.softWrapAt(wrapScreenColumn)
break if wrappedLine.hasOnlyPhantomTokens()
break if wrappedLine.hasOnlySoftWrapIndentation()
screenLines.push(wrappedLine)
softWraps++
screenLines.push(tokenizedLine)