feat(doc): more updates

This commit is contained in:
Barrett Ruth 2026-02-02 16:51:48 -05:00
parent 686b02b790
commit ec028dd0e5

View file

@ -10,6 +10,14 @@ fugitive-ts.nvim adds treesitter-based syntax highlighting to vim-fugitive
diff views. It overlays language-aware highlights on top of fugitive's diff views. It overlays language-aware highlights on top of fugitive's
default regex-based diff highlighting. default regex-based diff highlighting.
Features: ~
- Syntax highlighting in |:Git| summary diffs and commit detail views
- Syntax highlighting in |:Gdiffsplit| / |:Gvdiffsplit| side-by-side diffs
- Vim syntax fallback for languages without a treesitter parser
- Blended diff background colors that preserve syntax visibility
- Optional diff prefix (`+`/`-`/` `) concealment
- Gutter (line number) highlighting
============================================================================== ==============================================================================
REQUIREMENTS *fugitive-ts-requirements* REQUIREMENTS *fugitive-ts-requirements*
@ -148,19 +156,31 @@ refresh({bufnr}) *fugitive-ts.refresh()*
============================================================================== ==============================================================================
IMPLEMENTATION *fugitive-ts-implementation* IMPLEMENTATION *fugitive-ts-implementation*
1. The `FileType fugitive` autocmd triggers |fugitive-ts.attach()| Summary / commit detail views: ~
2. The buffer is parsed to detect file headers (`M path/to/file.lua`) and 1. `FileType fugitive` or `FileType git` (for `fugitive://` buffers)
hunk headers (`@@ -10,3 +10,4 @@`) triggers |fugitive-ts.attach()|
2. The buffer is parsed to detect file headers (`M path/to/file`,
`diff --git a/... b/...`) and hunk headers (`@@ -10,3 +10,4 @@`)
3. For each hunk: 3. For each hunk:
- Language is detected from the filename using |vim.filetype.match()| - Language is detected from the filename using |vim.filetype.match()|
- Diff prefixes (`+`/`-`/` `) are stripped from code lines - Diff prefixes (`+`/`-`/` `) are stripped from code lines
- Code is parsed with |vim.treesitter.get_string_parser()| - Code is parsed with |vim.treesitter.get_string_parser()|
- If no treesitter parser and `vim.enabled`: vim syntax fallback via
scratch buffer and |synID()|
- Background extmarks (`FugitiveTsAdd`/`FugitiveTsDelete`) at priority 198 - Background extmarks (`FugitiveTsAdd`/`FugitiveTsDelete`) at priority 198
- `Normal` extmarks at priority 199 clear underlying diff foreground - `Normal` extmarks at priority 199 clear underlying diff foreground
- Treesitter highlights are applied as extmarks at priority 200 - Syntax highlights are applied as extmarks at priority 200
- Conceal extmarks hide diff prefixes when `hide_prefix` is enabled - Conceal extmarks hide diff prefixes when `hide_prefix` is enabled
4. Re-highlighting occurs on `TextChanged` (debounced) and `Syntax` events 4. Re-highlighting occurs on `TextChanged` (debounced) and `Syntax` events
Diffsplit views: ~
1. `OptionSet diff` detects when a window enters diff mode
2. If any `&diff` window in the tabpage contains a `fugitive://` buffer,
all `&diff` windows receive a window-local 'winhighlight' override
3. The override remaps `DiffAdd`/`DiffDelete`/`DiffChange`/`DiffText` to
background-only variants, allowing existing treesitter highlighting to
show through the diff colors
============================================================================== ==============================================================================
KNOWN LIMITATIONS *fugitive-ts-limitations* KNOWN LIMITATIONS *fugitive-ts-limitations*