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

Emit text and marker change events when skipping undo #261

Merged
merged 1 commit into from
Sep 20, 2017

Conversation

as-cii
Copy link
Contributor

@as-cii as-cii commented Sep 20, 2017

Back in #255 we introduced a regression that prevented the following events from firing when calling setTextInRange with undo: 'skip':

  • buffer.onDidChangeText
  • buffer.onDidStopChanging
  • markerLayer.onDidUpdate
  • marker.onDidChange

This pull-request fixes it by calling emitMarkerChangeEvents and emitDidChangeTextEvent at the end of setTextInRange if the transact call depth is 0 and undo is 'skip'.

/cc: @nathansobo

@as-cii as-cii force-pushed the as-fix-emitting-marker-and-text-events branch from 6ab57fa to 4167c2d Compare September 20, 2017 12:23
@nathansobo
Copy link
Contributor

I see, because we don't transact if we're skipping undo and so the events that typically are fired at the end of the transaction are skipped. 👍

@nathansobo nathansobo merged commit b7f9571 into master Sep 20, 2017
@nathansobo nathansobo deleted the as-fix-emitting-marker-and-text-events branch September 20, 2017 15:52
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.

2 participants