Skip to content

fix(api): persist selections to disk after set_revs so they survive restart#101

Merged
dlyongemallo merged 1 commit intomainfrom
persist_selection_set_revs
Apr 13, 2026
Merged

fix(api): persist selections to disk after set_revs so they survive restart#101
dlyongemallo merged 1 commit intomainfrom
persist_selection_set_revs

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

@dlyongemallo dlyongemallo commented Apr 12, 2026

Relates to #88.

Copilot AI review requested due to automatic review settings April 12, 2026 18:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR ensures DiffView file selections are persisted to disk under the new selection scope after DiffView:set_revs(), so selections survive a Neovim restart when the revision range changes.

Changes:

  • Persist selections immediately after switching to the new selection scope key in DiffView:set_revs().
  • Add a functional test covering persistence under the new scope key after a rev change.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lua/diffview/scene/views/diff/diff_view.lua Saves selections under the updated scope key during set_revs() so persistence matches the new rev range.
lua/diffview/tests/functional/set_revs_spec.lua Adds a regression test asserting selections are saved under the new scope key after set_revs().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lua/diffview/scene/views/diff/diff_view.lua Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dlyongemallo dlyongemallo force-pushed the persist_selection_set_revs branch from ccf1e76 to e528a4a Compare April 13, 2026 05:38
@dlyongemallo dlyongemallo merged commit 4527b46 into main Apr 13, 2026
2 checks passed
@dlyongemallo dlyongemallo deleted the persist_selection_set_revs branch April 13, 2026 06:19
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.

2 participants