mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 18:24:09 +03:00
🐛 Fix race condition as well
This commit is contained in:
parent
b0d93accf7
commit
b04b0a8dc4
@ -67,6 +67,15 @@ describe "TextEditorComponent", ->
|
||||
|
||||
expect(nextAnimationFrame).not.toThrow()
|
||||
|
||||
it "doesn't update when an animation frame was requested but the component got destroyed before its delivery", ->
|
||||
editor.setText("You shouldn't see this update.")
|
||||
expect(nextAnimationFrame).not.toBe(noAnimationFrame)
|
||||
|
||||
component.destroy()
|
||||
nextAnimationFrame()
|
||||
|
||||
expect(component.lineNodeForScreenRow(0).textContent).not.toBe("You shouldn't see this update.")
|
||||
|
||||
describe "line rendering", ->
|
||||
expectTileContainsRow = (tileNode, screenRow, {top}) ->
|
||||
lineNode = tileNode.querySelector("[data-screen-row='#{screenRow}']")
|
||||
|
@ -195,7 +195,7 @@ class TextEditorComponent
|
||||
@updateRequested = true
|
||||
atom.views.updateDocument =>
|
||||
@updateRequested = false
|
||||
@updateSync() if @editor.isAlive()
|
||||
@updateSync() if @canUpdate()
|
||||
atom.views.readDocument(@readAfterUpdateSync)
|
||||
|
||||
canUpdate: ->
|
||||
|
Loading…
Reference in New Issue
Block a user