Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UndoManager Fixes #25

Merged

Conversation

thecoolwinter
Copy link
Contributor

@thecoolwinter thecoolwinter commented Feb 24, 2024

Description

  • Fixes incorrect use of grouping in replaceCharacters. Fixes an issue where every edit was grouped, disabling the ability to undo individual operations. Future work will need to be done to enable grouping undo operations for multi-cursor operations.
  • Makes undo/redo text storage operations occur in a transaction. Makes those operations appear as a single coalesced edit when sent to text storage delegates.
  • Fixes an issue where the undo manager would never group the sequence of Newline + Whitespace (eg when making a newline and then inserting a tab). Also fixes the grouping order when deleting lines, so undoing a deleted line behaves as expected.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

N/A

@thecoolwinter thecoolwinter marked this pull request as draft February 29, 2024 05:16
@thecoolwinter thecoolwinter marked this pull request as ready for review February 29, 2024 20:03
@thecoolwinter thecoolwinter changed the title Misc. UndoManager Fixes UndoManager Fixes Feb 29, 2024
austincondiff
austincondiff previously approved these changes Feb 29, 2024
tom-ludwig
tom-ludwig previously approved these changes Feb 29, 2024
Copy link
Member

@tom-ludwig tom-ludwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for documenting your code too, really appreciate it.

@thecoolwinter thecoolwinter merged commit 86b9804 into CodeEditApp:main Mar 1, 2024
2 checks passed
thecoolwinter added a commit to CodeEditApp/CodeEditSourceEditor that referenced this pull request Mar 1, 2024
### Description

- Cleans up undo/redo operations when TextFormation is activated, for
instance when inserting or deleting a newline.

> ~Note: Requires
[CodeEditTextView#25](CodeEditApp/CodeEditTextView#25)
to be merged.~ Merged!

### Related Issues

* closes #233

### Checklist

- [x] I read and understood the [contributing
guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md)
as well as the [code of
conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md)
- [x] The issues this PR addresses are related to each other
- [x] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] My changes are all related to the related issue above
- [x] I documented my code

### Screenshots


https://github.com/CodeEditApp/CodeEditSourceEditor/assets/35942988/d842b77d-60b4-4afd-be6c-2fb3d0342c4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants