mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
Cache hidden/visible state of cursor to avoid extra DOM hit when updating its appearance
This commit is contained in:
@@ -12,6 +12,7 @@ class Cursor extends View
|
||||
anchor: null
|
||||
editor: null
|
||||
wordRegex: /(\w+)|([^\w\s]+)/g
|
||||
hidden: false
|
||||
|
||||
initialize: ({editor, screenPosition} = {}) ->
|
||||
@editor = editor
|
||||
@@ -178,8 +179,10 @@ class Cursor extends View
|
||||
@editor.scrollTo(pixelPosition)
|
||||
|
||||
if @editor.isFoldedAtScreenRow(screenPosition.row)
|
||||
@hide()
|
||||
@hide() unless @hidden
|
||||
@hidden = true
|
||||
else
|
||||
@show()
|
||||
@show() if @hidden
|
||||
@hidden = false
|
||||
|
||||
@selection.updateAppearance()
|
||||
|
||||
Reference in New Issue
Block a user