Override isHidden for the CursorView

We know it's visible if it is on the dom and doesn't have 
display == none set. This is an order of magnitude faster than the 
default implementation which calls getComputedStyle()
This commit is contained in:
Ben Ogle
2013-10-01 16:45:43 -07:00
parent 303124f1dd
commit c2bb5a998b

View File

@@ -54,6 +54,14 @@ class CursorView extends View
@setVisible(@cursor.isVisible() and not @editor.isFoldedAtScreenRow(screenPosition.row))
# Override for speed. The base function checks the computedStyle
isHidden: ->
style = this[0].style
if style.display == 'none' or not @isOnDom()
true
else
false
needsAutoscroll: ->
@cursor.needsAutoscroll