fix: buffer matching, cross-tab refresh, staged rename flicker#308
Merged
esmuellert merged 3 commits intomainfrom Mar 5, 2026
Merged
fix: buffer matching, cross-tab refresh, staged rename flicker#308esmuellert merged 3 commits intomainfrom
esmuellert merged 3 commits intomainfrom
Conversation
Git watcher discarded fs_event callbacks when the codediff tab wasn't active. If the user committed from another tab, the event was lost and diff panes stayed stale on return. Set _pending_refresh flag when events fire on wrong tabpage and add TabEnter autocmd to flush pending refreshes when the user returns to the codediff tab. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
vim.fn.bufnr() uses pattern/prefix matching, causing collisions when one filename is a prefix of another (e.g. Makefile matching Makefile.win). This caused the left diff pane to show stale content when navigating between such files. Replace with exact nvim_buf_get_name() comparison to ensure the correct buffer is returned. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The same-file check in on_file_select failed for staged renames because session.modified_path is relative while abs_path is absolute. Each explorer refresh re-triggered view.update(), causing visible flicker. Add session.modified_path == file_path to the check to handle staged files where paths are stored as relative. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three targeted bug fixes from dev branch.
Changes
fix(helpers): use exact buffer name matching in prepare_buffer
vim.fn.bufnr()uses pattern/prefix matching, causing collisions when one filename is a prefix of another (e.g.MakefilematchingMakefile.win). This caused the left diff pane to show stale content when navigating between such files. Replaced with exactnvim_buf_get_name()comparison.fix(refresh): show welcome after cross-tab commit
Git watcher discarded fs_event callbacks when the codediff tab wasn't active. If the user committed from another tab, the event was lost and diff panes stayed stale on return. Added
_pending_refreshflag andTabEnterautocmd to flush pending refreshes.fix(render): prevent diff flicker for staged renames
The same-file check in
on_file_selectfailed for staged renames becausesession.modified_pathis relative whileabs_pathis absolute. Each explorer refresh re-triggeredview.update(), causing visible flicker. Addedsession.modified_path == file_pathto the check.Testing