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

Restore markers correctly after redo - #65

Merged
maxbrunsfeld merged 1 commit into
masterfrom
mb-undo-snapshots
May 26, 2015
Merged

maxbrunsfeld merged 1 commit into
masterfrom
mb-undo-snapshots

Conversation

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

Fixes atom/atom#6915

Problem

Currently, on redo, we restore markers to the state they were in before the corresponding undo operation. This is not quite right; markers that have existed since the redone change should be restored to the state they were in after the redone change initially occurred.

Solution

Previously, we created marker snapshots in 3 situations: before transactions, before undo, and before redo. To fix this bug, we need to also create a marker snapshot immediately after every transaction. So now I do that as part of emitting marker change events, and store the marker snapshot as a new property on the TextBuffer: lastMarkerSnapshot.

/cc @nathansobo could you review this?

maxbrunsfeld pushed a commit that referenced this pull request May 26, 2015
Restore markers correctly after redo
@maxbrunsfeld
maxbrunsfeld merged commit 523713c into master May 26, 2015
@maxbrunsfeld
maxbrunsfeld deleted the mb-undo-snapshots branch May 26, 2015 23:49
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.

Position of cursor after undo+redo is incorrect

1 participant