mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
🐎 Use cached pair character information
Tokenized lines break out atomic tokens so trust the hasPairCharacter value on the token instead of rechecking it.
This commit is contained in:
@@ -11,7 +11,6 @@ Fold = require './fold'
|
||||
Token = require './token'
|
||||
Decoration = require './decoration'
|
||||
Marker = require './marker'
|
||||
textUtils = require './text-utils'
|
||||
Grim = require 'grim'
|
||||
|
||||
class BufferToScreenConversionError extends Error
|
||||
@@ -654,7 +653,7 @@ class DisplayBuffer extends Model
|
||||
charWidths = @getScopedCharWidths(token.scopes)
|
||||
valueIndex = 0
|
||||
while valueIndex < token.value.length
|
||||
if textUtils.isPairedCharacter(token.value, valueIndex)
|
||||
if token.hasPairedCharacter
|
||||
char = token.value.substr(valueIndex, 2)
|
||||
charLength = 2
|
||||
valueIndex += 2
|
||||
@@ -683,7 +682,7 @@ class DisplayBuffer extends Model
|
||||
charWidths = @getScopedCharWidths(token.scopes)
|
||||
valueIndex = 0
|
||||
while valueIndex < token.value.length
|
||||
if textUtils.isPairedCharacter(token.value, valueIndex)
|
||||
if token.hasPairedCharacter
|
||||
char = token.value.substr(valueIndex, 2)
|
||||
charLength = 2
|
||||
valueIndex += 2
|
||||
|
||||
Reference in New Issue
Block a user