diffs.nvim/lua/diffs
Barrett Ruth 33c58c7498 fix(parser): detect filetype from file content (shebang/modeline)
When a file has no extension but contains a shebang (e.g., `#!/bin/bash`),
filetype detection now reads the first 10 lines from disk and uses
`vim.filetype.match({ filename, contents })` for content-based detection.

This enables syntax highlighting for files like `build` scripts that rely
on shebang detection, even when the file isn't open in a buffer.

Detection order:
1. Existing buffer's filetype (already implemented in #69)
2. File content (shebang/modeline) - NEW
3. Filename extension only

Also adds `filetype on` to test helpers to ensure `vim.g.ft_ignore_pat`
is set, which is required for shell detection.
2026-02-05 01:08:43 -05:00
..
commands.lua feat(fugitive): line position tracking for keymaps 2026-02-05 00:27:35 -05:00
fugitive.lua feat(fugitive): line position tracking for keymaps 2026-02-05 00:27:35 -05:00
git.lua feat(git): add index and working tree content retrieval 2026-02-04 22:23:09 -05:00
health.lua feat: rename everything 2026-02-02 22:09:13 -05:00
highlight.lua feat: add :Gdiff, :Gvdiff, :Ghdiff commands for unified diff view 2026-02-04 19:52:17 -05:00
init.lua feat(fugitive): add status buffer keymaps for unified diffs 2026-02-04 22:23:21 -05:00
log.lua feat: add :Gdiff, :Gvdiff, :Ghdiff commands for unified diff view 2026-02-04 19:52:17 -05:00
parser.lua fix(parser): detect filetype from file content (shebang/modeline) 2026-02-05 01:08:43 -05:00