Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Only emit one display layer change event per buffer transaction #274

Merged
merged 9 commits into from
Oct 31, 2017

Conversation

maxbrunsfeld
Copy link
Contributor

@maxbrunsfeld maxbrunsfeld commented Oct 30, 2017

Similar to #270, #273

Previously, DisplayLayers would call their onDidChangeSync callbacks once each time their underlying TextBuffer changed. This was a source of slowness when typing with multiple cursors and prevented us from wanting to implement features like auto-indent in terms of a series of small buffer changes.

In this PR, I've renamed .onDidChangeSync to .onDidChange and changed it so that callbacks are only called one time per text buffer transaction. I have also changed the events that it emits so that instead of having start, oldExtent and newExtent properties, they have oldRange and newRange properties similar to TextBuffer.onDidChange events.

/cc @nathansobo

@maxbrunsfeld maxbrunsfeld force-pushed the mb-one-display-layer-event-per-tx branch from 8a0593d to 6f97438 Compare October 30, 2017 20:14
@maxbrunsfeld maxbrunsfeld merged commit c185463 into master Oct 31, 2017
@maxbrunsfeld maxbrunsfeld deleted the mb-one-display-layer-event-per-tx branch October 31, 2017 17:09
This was referenced Oct 31, 2017
This was referenced Oct 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant