Skip to content

fix(file): emit BufReadPost after async keymap registration#106

Merged
dlyongemallo merged 1 commit intomainfrom
564-fix_keymap_registration
Apr 13, 2026
Merged

fix(file): emit BufReadPost after async keymap registration#106
dlyongemallo merged 1 commit intomainfrom
564-fix_keymap_registration

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

Fixes sindrets#564.

Copilot AI review requested due to automatic review settings April 13, 2026 06:16
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 addresses diff buffer keymaps being registered after initial buffer events, by explicitly re-triggering BufReadPost once diffview has finished attaching buffer-local keymaps (intended to make plugins like which-key.nvim pick them up immediately).

Changes:

  • Emit BufReadPost after File:attach_buffer() finishes applying buffer-local keymaps/opts.
  • Skip the BufReadPost emission when diffview_disable_ts is set (large file treesitter optimization).

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

Comment thread lua/diffview/vcs/file.lua Outdated
Comment thread lua/diffview/vcs/file.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 1 comment.


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

Comment thread lua/diffview/vcs/file.lua Outdated
Fire `BufReadPost` on the buffer after `attach_buffer() registers keymaps
so `which-key.nvim` (>=3.5.0) re-scans buffer-local keymaps.
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 merged commit 7881b4c into main Apr 13, 2026
6 checks passed
@dlyongemallo dlyongemallo deleted the 564-fix_keymap_registration branch April 14, 2026 18:59
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.

[Bug] Custom keymaps prefixed with <localleader> aren't available immediately after opening diffview

2 participants