mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
TokenizedLine::screenColumnForBufferColumn calculates more accurately
screenColumnForBufferColumn used to break only if the current column was strictly greater than the target column. This commit changes it so it breaks when greater or equal, which is how bufferColumnForScreenColumn works. This also adds some unit tests for screenColumnForBufferColumn's interactions with hard tab characters.
This commit is contained in:
@@ -67,7 +67,7 @@ class TokenizedLine
|
||||
screenColumn = 0
|
||||
currentBufferColumn = 0
|
||||
for token in @tokens
|
||||
break if currentBufferColumn > bufferColumn
|
||||
break if currentBufferColumn + token.bufferDelta > bufferColumn
|
||||
screenColumn += token.screenDelta
|
||||
currentBufferColumn += token.bufferDelta
|
||||
@clipScreenColumn(screenColumn + (bufferColumn - currentBufferColumn))
|
||||
|
||||
Reference in New Issue
Block a user