Skip to content

fix(commands): add diff buffer UX improvements#95

Merged
barrettruth merged 2 commits intomainfrom
fix/ux-tweaks
Feb 7, 2026
Merged

fix(commands): add diff buffer UX improvements#95
barrettruth merged 2 commits intomainfrom
fix/ux-tweaks

Conversation

@barrettruth
Copy link
Owner

Problem

diffs:// buffers could trigger spurious LSP diagnostics since LSP servers
try to attach to non-file URI schemes. Opening multiple diffs from the
fugitive status buffer created redundant window splits. No quick way to
close diff windows without :close or :q.

Solution

Three targeted UX improvements to diff buffer handling:

  1. Diagnostic suppression — disable vim.diagnostic on all diffs://
    buffers immediately after creation
  2. Window reuse — when a diffs:// window already exists in the
    tabpage, replace its buffer instead of creating a new split
  3. q keymap — buffer-local q mapping to close the diff window,
    following the fugitive convention for auxiliary views

All three are wired through setup_diff_buf() and find_diffs_window()
helpers called from gdiff(), gdiff_file(), and gdiff_section().

Closes #83

Problem: diffs:// buffers could trigger spurious LSP diagnostics,
opening multiple diffs from fugitive created redundant splits, and
there was no quick way to close diff windows.

Solution: disable diagnostics on diff buffers, reuse existing
diffs:// windows in the tabpage instead of creating new splits,
and add a buffer-local q keymap to close diff windows.
@barrettruth barrettruth merged commit e06d229 into main Feb 7, 2026
7 checks passed
@barrettruth barrettruth deleted the fix/ux-tweaks branch February 7, 2026 21: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.

feature: avoid diagnostic bugs on merge resolve?

1 participant