mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Don't blink the cursor if it should not be visible
Also, when stopping blinking, set the cursor's visibility to whatever it is on the underlying model. This fixes issues where the cursor would blink when there was a selection.
This commit is contained in:
@@ -67,16 +67,16 @@ class CursorView extends View
|
||||
@css('visibility', 'hidden')
|
||||
|
||||
toggleVisible: ->
|
||||
@setVisible(not @visible) if @cursor.isVisible
|
||||
@setVisible(not @visible)
|
||||
|
||||
stopBlinking: ->
|
||||
clearInterval(@blinkInterval) if @blinkInterval
|
||||
@blinkInterval = null
|
||||
@setVisible(true) if @cursor.isVisible
|
||||
@setVisible(@cursor.isVisible())
|
||||
|
||||
startBlinking: ->
|
||||
return if @blinkInterval?
|
||||
blink = => @toggleVisible()
|
||||
blink = => @toggleVisible() if @cursor.isVisible()
|
||||
@blinkInterval = setInterval(blink, @blinkPeriod / 2)
|
||||
|
||||
resetBlinking: ->
|
||||
|
||||
Reference in New Issue
Block a user