mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Iron out scheduling issues
* Ensure multiple calls to scheduleUpdate only result in a single call to updateSync in the future. * Explicit calls to update sync after scheduling an update fulfill the scheduled update. * Track whether we think the editor is visible or not to avoid redundant didShow calls. * Ensure we only update on resize events if the editor actually changed size.
This commit is contained in:
committed by
Antonio Scandurra
parent
19d1d148eb
commit
583c2c537d
@@ -19,7 +19,11 @@ describe('TextEditorComponent', () => {
|
||||
function buildComponent (params = {}) {
|
||||
const buffer = new TextBuffer({text: SAMPLE_TEXT})
|
||||
const editor = new TextEditor({buffer})
|
||||
const component = new TextEditorComponent({model: editor, rowsPerTile: params.rowsPerTile})
|
||||
const component = new TextEditorComponent({
|
||||
model: editor,
|
||||
rowsPerTile: params.rowsPerTile,
|
||||
updatedSynchronously: false
|
||||
})
|
||||
const {element} = component
|
||||
element.style.width = params.width ? params.width + 'px' : '800px'
|
||||
element.style.height = params.height ? params.height + 'px' : '600px'
|
||||
|
||||
Reference in New Issue
Block a user