mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Use the atom.views scheduler in TextEditorComponent
This ensures smooth scheduling interactions with autocomplete-plus overlays so they measure their dimensions at the right time.
This commit is contained in:
committed by
Antonio Scandurra
parent
1676617218
commit
4707803416
@@ -135,6 +135,7 @@ class AtomEnvironment extends Model
|
||||
@deserializers = new DeserializerManager(this)
|
||||
@deserializeTimings = {}
|
||||
@views = new ViewRegistry(this)
|
||||
TextEditor.setScheduler(@views)
|
||||
@notifications = new NotificationManager
|
||||
@updateProcessEnv ?= updateProcessEnv # For testing
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ function scaleMouseDragAutoscrollDelta (delta) {
|
||||
|
||||
module.exports =
|
||||
class TextEditorComponent {
|
||||
static setScheduler (scheduler) {
|
||||
etch.setScheduler(scheduler)
|
||||
}
|
||||
|
||||
static didUpdateScrollbarStyles () {
|
||||
if (this.attachedComponents) {
|
||||
this.attachedComponents.forEach((component) => {
|
||||
|
||||
@@ -61,6 +61,10 @@ class TextEditor extends Model
|
||||
@setClipboard: (clipboard) ->
|
||||
@clipboard = clipboard
|
||||
|
||||
@setScheduler: (scheduler) ->
|
||||
TextEditorComponent ?= require './text-editor-component'
|
||||
TextEditorComponent.setScheduler(scheduler)
|
||||
|
||||
@didUpdateScrollbarStyles: ->
|
||||
TextEditorComponent ?= require './text-editor-component'
|
||||
TextEditorComponent.didUpdateScrollbarStyles()
|
||||
|
||||
Reference in New Issue
Block a user