mirror of
https://github.com/atom/atom.git
synced 2026-02-16 01:25:13 -05:00
Blink cursors based on presenter state
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
@@ -226,16 +226,22 @@ TextEditorComponent = React.createClass
|
||||
@performedInitialMeasurement = true
|
||||
@updatesPaused = false
|
||||
|
||||
{editor, lineOverdrawMargin} = @props
|
||||
@presenter ?= new TextEditorPresenter
|
||||
model: editor
|
||||
clientHeight: editor.getHeight()
|
||||
clientWidth: editor.getWidth()
|
||||
scrollTop: editor.getScrollTop()
|
||||
scrollLeft: editor.getScrollLeft()
|
||||
lineHeight: editor.getLineHeightInPixels()
|
||||
baseCharacterWidth: editor.getDefaultCharWidth()
|
||||
lineOverdrawMargin: lineOverdrawMargin
|
||||
{editor, lineOverdrawMargin, cursorBlinkPeriod, cursorBlinkResumeDelay} = @props
|
||||
|
||||
|
||||
unless @presenter?
|
||||
@presenter = new TextEditorPresenter
|
||||
model: editor
|
||||
clientHeight: editor.getHeight()
|
||||
clientWidth: editor.getWidth()
|
||||
scrollTop: editor.getScrollTop()
|
||||
scrollLeft: editor.getScrollLeft()
|
||||
lineHeight: editor.getLineHeightInPixels()
|
||||
baseCharacterWidth: editor.getDefaultCharWidth()
|
||||
lineOverdrawMargin: lineOverdrawMargin
|
||||
cursorBlinkPeriod: cursorBlinkPeriod
|
||||
cursorBlinkResumeDelay: cursorBlinkResumeDelay
|
||||
@presenter.onDidUpdateState(@requestUpdate)
|
||||
|
||||
@forceUpdate() if @canUpdate()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user