diffs.nvim/spec
Barrett Ruth 0dc8a0ec0f 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:04:23 -05:00
..
commands_spec.lua feat(fugitive): line position tracking for keymaps 2026-02-05 00:27:35 -05:00
fugitive_spec.lua feat(fugitive): line position tracking for keymaps 2026-02-05 00:27:35 -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(parser): detect filetype from file content (shebang/modeline) 2026-02-05 01:04:23 -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 file content (shebang/modeline) 2026-02-05 01:04:23 -05:00