Skip to content

fix(keymaps): save and restore buffer-local keymaps on attach/detach#4

Merged
dlyongemallo merged 1 commit intomainfrom
fix_keymap_restore
Feb 6, 2026
Merged

fix(keymaps): save and restore buffer-local keymaps on attach/detach#4
dlyongemallo merged 1 commit intomainfrom
fix_keymap_restore

Conversation

@dlyongemallo
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 6, 2026 15:35
@dlyongemallo dlyongemallo merged commit 6bf56a3 into main Feb 6, 2026
4 checks passed
@dlyongemallo dlyongemallo deleted the fix_keymap_restore branch February 6, 2026 15:37
Copy link

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 updates Diffview’s buffer attach/detach logic to preserve and restore any pre-existing buffer-local keymaps that Diffview overwrites, preventing user mappings from being lost after closing a view.

Changes:

  • Track and save existing buffer-local keymaps (per mode + lhs) before Diffview sets its own mappings.
  • On detach, remove Diffview mappings and restore any saved original mappings.
  • Extend vcs.File.AttachState with saved_keymaps to persist restoration data across attaches.

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

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