fix: always attach for configured filetypes #217

Merged
barrettruth merged 1 commit from fix/always-attach into main 2026-04-22 18:02:02 +00:00
barrettruth commented 2026-04-22 17:59:32 +00:00

The FileType autocmd previously bailed out for ft=git buffers unless they were fugitive (fugitive:// URI or b:git_dir set) or committia (__committia_diff__$ name). This blocked highlighting on every other legitimate ft=git source: scratch preview buffers from pickers (fzf-lua, telescope, snacks), piped git show/git log output, and any :setf git buffer.

Removing the bailout makes attach unconditional for every filetype returned by compute_filetypes. Non-diff buffers parse to zero hunks and produce no extmarks, so the cost on .git/HEAD, refs, and similar small files is negligible.

is_fugitive_buffer and get_committia_config remain as public API for any external consumer; they're just no longer used internally to gate attach.

Vimdoc updated for the three sites that documented the old gate (extra_filetypes, attach(), IMPLEMENTATION).

The `FileType` autocmd previously bailed out for `ft=git` buffers unless they were fugitive (`fugitive://` URI or `b:git_dir` set) or committia (`__committia_diff__$` name). This blocked highlighting on every other legitimate `ft=git` source: scratch preview buffers from pickers (fzf-lua, telescope, snacks), piped `git show`/`git log` output, and any `:setf git` buffer. Removing the bailout makes attach unconditional for every filetype returned by `compute_filetypes`. Non-diff buffers parse to zero hunks and produce no extmarks, so the cost on `.git/HEAD`, refs, and similar small files is negligible. `is_fugitive_buffer` and `get_committia_config` remain as public API for any external consumer; they're just no longer used internally to gate attach. Vimdoc updated for the three sites that documented the old gate (`extra_filetypes`, `attach()`, IMPLEMENTATION).
Sign in to join this conversation.
No description provided.