Skip to content

fix(fugitive): filetype attach fixes#205

Merged
barrettruth merged 1 commit intomainfrom
fix/git-filetype-guard
Mar 25, 2026
Merged

fix(fugitive): filetype attach fixes#205
barrettruth merged 1 commit intomainfrom
fix/git-filetype-guard

Conversation

@barrettruth
Copy link
Copy Markdown
Owner

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.
@barrettruth barrettruth merged commit 0cb16a0 into main Mar 25, 2026
8 checks passed
@barrettruth barrettruth deleted the fix/git-filetype-guard branch March 25, 2026 15:24
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.

1 participant