Better naming

...thanks @nathansobo
This commit is contained in:
Antonio Scandurra
2015-02-18 09:52:23 +01:00
parent 5e4221f91c
commit b0c670b80a
3 changed files with 7 additions and 7 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.isInsidePhantomToken(column)
else if screenLine.isColumnInsidePhantomToken(column)
row--
column = @screenLines[row].getMaxScreenColumn()
else if wrapBeyondNewlines and column > maxScreenColumn and row < @getLastRow()
@@ -873,7 +873,7 @@ class DisplayBuffer extends Model
return line.text.length
else
# search backward for the start of the word on the boundary
for column in [softWrapColumn..0] when line.isOutsidePhantomToken(column)
for column in [softWrapColumn..0] when line.isColumnOutsidePhantomToken(column)
return column + 1 if /\s/.test(line.text[column])
return softWrapColumn

View File

@@ -144,7 +144,7 @@ class Token
isHardTab: isHardTab
)
buildPhantomToken: (length) ->
buildPhantomTabToken: (length) ->
new Token(
value: _.multiplyString(" ", length),
scopes: @scopes,

View File

@@ -99,7 +99,7 @@ class TokenizedLine
leftTextLength += nextToken.value.length
leftTokens.push nextToken
tab = leftTokens[0].buildPhantomToken(@indentLevel * @tabLength)
phantomTab = leftTokens[0].buildPhantomTabToken(@indentLevel * @tabLength)
leftFragment = new TokenizedLine(
tokens: leftTokens
@@ -111,7 +111,7 @@ class TokenizedLine
tabLength: @tabLength
)
rightFragment = new TokenizedLine(
tokens: [tab].concat(rightTokens)
tokens: [phantomTab].concat(rightTokens)
startBufferColumn: @bufferColumnForScreenColumn(column)
ruleStack: @ruleStack
invisibles: @invisibles
@@ -124,12 +124,12 @@ class TokenizedLine
isSoftWrapped: ->
@lineEnding is null
isOutsidePhantomToken: (column) ->
isColumnOutsidePhantomToken: (column) ->
return true unless @tokens[0].isPhantom
column > @tokens[0].screenDelta
isInsidePhantomToken: (column) ->
isColumnInsidePhantomToken: (column) ->
return false unless @tokens[0].isPhantom
column < @tokens[0].screenDelta