diffs.nvim/spec
Barrett Ruth c51d625dc6 fix(parser): detect filetype from existing buffer
Files detected via shebang or modeline (e.g., `build` with `#!/bin/bash`)
weren't getting syntax highlighting because `vim.filetype.match()` only
does filename-based detection.

Now `get_ft_from_filename()` first checks if a buffer already exists for
the file and uses its detected filetype. This requires knowing the repo
root to construct the full path, so:

- `parse_buffer()` reads `b:diffs_repo_root` or `b:git_dir` (fugitive)
- `commands.lua` sets `b:diffs_repo_root` on diff buffers it creates

Co-authored-by: phanen <phanen@qq.com>
2026-02-05 00:13:32 -05:00
..
commands_spec.lua feat: add :Gdiff, :Gvdiff, :Ghdiff commands for unified diff view 2026-02-04 19:52:17 -05:00
fugitive_spec.lua fix(tests): suppress unused variable warnings for selene 2026-02-04 23:25:39 -05:00
git_spec.lua feat: add :Gdiff, :Gvdiff, :Ghdiff commands for unified diff view 2026-02-04 19:52:17 -05:00
helpers.lua fix(test): hopefully they work 2026-02-01 23:41:59 -05:00
highlight_spec.lua feat: add :Gdiff, :Gvdiff, :Ghdiff commands for unified diff view 2026-02-04 19:52:17 -05:00
init_spec.lua feat(config): use vim.g over .setup() 2026-02-03 16:18:55 -05:00
minimal_init.lua feat(test): testing infrastructure 2026-02-01 23:09:05 -05:00
parser_spec.lua fix(parser): detect filetype from existing buffer 2026-02-05 00:13:32 -05:00