mirror of
https://github.com/atom/atom.git
synced 2026-02-16 17:45:24 -05:00
Better naming
...thanks @nathansobo
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -144,7 +144,7 @@ class Token
|
||||
isHardTab: isHardTab
|
||||
)
|
||||
|
||||
buildPhantomToken: (length) ->
|
||||
buildPhantomTabToken: (length) ->
|
||||
new Token(
|
||||
value: _.multiplyString(" ", length),
|
||||
scopes: @scopes,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user