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

Kakoune-like selection history #9145

Closed
wants to merge 4 commits into from
Closed

Conversation

kirawi
Copy link
Member

@kirawi kirawi commented Dec 23, 2023

Resolves #1596 by implementing a separate selection history. Each selection revision tracks the associated edit revision and selections are automatically mapped to different document revisions.

Waiting to see what should be done about transaction selections to finish this PR.

kirawi added 2 commits December 22, 2023 20:34
@kirawi
Copy link
Member Author

kirawi commented Dec 23, 2023

I tried to take a look at how Kakoune implemented it, and while I didn't understand the edition terminology, it looked pretty similar to the regular history for edits so I did that and map selections to the current buffer. There are a few open questions I stumbled upon:

  • Document::selections could be turned into HashMap<ViewId, SelectionHistory>
    • Was thinking of using an index to each selection, but wouldn't work for mapped selections.
  • How should I handle the selections in each transaction? Should the field be removed?
  • Is the History::between() function correct?

@kirawi kirawi marked this pull request as draft December 23, 2023 02:05
@kirawi
Copy link
Member Author

kirawi commented Jan 5, 2025

Closing as stale

@kirawi kirawi closed this Jan 5, 2025
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.

Soft undo/redo (de)selection
1 participant