fix(fugitive): filetype attach fixes #205

Merged
barrettruth merged 1 commit from fix/git-filetype-guard into main 2026-03-25 15:24:44 +00:00
barrettruth commented 2026-03-25 15:23:33 +00:00

Problem: :Git show (and similar fugitive commands) creates temp
buffers under /tmp/ with filetype=git instead of fugitive://
URIs. The is_fugitive_buffer check only matched ^fugitive://,
so these buffers were silently skipped by the FileType autocmd.

Solution: also check vim.b.git_dir which fugitive sets on all its
managed buffers, including temp output buffers from :Git commands.

Problem: `:Git show` (and similar fugitive commands) creates temp buffers under `/tmp/` with `filetype=git` instead of `fugitive://` URIs. The `is_fugitive_buffer` check only matched `^fugitive://`, so these buffers were silently skipped by the `FileType` autocmd. Solution: also check `vim.b.git_dir` which fugitive sets on all its managed buffers, including temp output buffers from `:Git` commands.
Sign in to join this conversation.
No description provided.