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

Don't notify observers of onDidChangeText after an empty transaction #230

Merged
merged 1 commit into from
May 8, 2017

Conversation

as-cii
Copy link
Contributor

@as-cii as-cii commented May 8, 2017

In Atom we are using transactions to emit a single onDidUpdate event on marker layers when multiple markers are manually moved at the same time.

Previously, even when not making any changes to the buffer during one of these transactions, we would emit an onDidChangeText event with an empty list of changed regions. Packages could, however, rely on this event to perform destructive actions, and that should not happen as a result of a simple cursor movement. This was causing some test failures in atom/atom#12696.

For this reason, with this pull request we are changing the onDidChangeText event to be emitted only when the buffer is modified.

/cc: @nathansobo

@as-cii as-cii merged commit b73191c into master May 8, 2017
@as-cii as-cii deleted the as-no-textchange-events-for-empty-transactions branch May 8, 2017 17:36
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.

1 participant