Merge pull request #53 from barrettruth/fix/known-limitation-syntax
docs: add incomplete syntax context as known limitation
This commit is contained in:
commit
4008df3558
2 changed files with 18 additions and 0 deletions
|
|
@ -37,6 +37,13 @@ luarocks install diffs.nvim
|
||||||
|
|
||||||
## Known Limitations
|
## Known Limitations
|
||||||
|
|
||||||
|
- **Incomplete syntax context**: Treesitter parses each diff hunk in isolation
|
||||||
|
without surrounding code context. When a hunk shows lines added to an existing
|
||||||
|
block (e.g., adding a plugin inside `return { ... }`), the parser doesn't see
|
||||||
|
the `return` statement and may produce incorrect highlighting. This is
|
||||||
|
inherent to parsing code fragments—no diff tooling solves this without
|
||||||
|
significant complexity.
|
||||||
|
|
||||||
- **Syntax flashing**: `diffs.nvim` hooks into the `FileType fugitive` event
|
- **Syntax flashing**: `diffs.nvim` hooks into the `FileType fugitive` event
|
||||||
triggered by `vim-fugitive`, at which point the buffer is preliminarily
|
triggered by `vim-fugitive`, at which point the buffer is preliminarily
|
||||||
painted. The buffer is then re-painted after `debounce_ms` milliseconds,
|
painted. The buffer is then re-painted after `debounce_ms` milliseconds,
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,17 @@ Diff mode views: ~
|
||||||
==============================================================================
|
==============================================================================
|
||||||
KNOWN LIMITATIONS *diffs-limitations*
|
KNOWN LIMITATIONS *diffs-limitations*
|
||||||
|
|
||||||
|
Incomplete Syntax Context ~
|
||||||
|
*diffs-syntax-context*
|
||||||
|
Treesitter parses each diff hunk in isolation without surrounding code
|
||||||
|
context. When a hunk shows lines added to an existing block (e.g., adding a
|
||||||
|
plugin inside `return { ... }`), the parser doesn't see the `return`
|
||||||
|
statement and may produce incorrect or unusual highlighting.
|
||||||
|
|
||||||
|
This is inherent to parsing code fragments. No diff tooling solves this
|
||||||
|
problem without significant complexity—the parser simply doesn't have enough
|
||||||
|
information to understand the full syntactic structure.
|
||||||
|
|
||||||
Syntax Highlighting Flash ~
|
Syntax Highlighting Flash ~
|
||||||
*diffs-flash*
|
*diffs-flash*
|
||||||
When opening a fugitive buffer, there is an unavoidable visual "flash" where
|
When opening a fugitive buffer, there is an unavoidable visual "flash" where
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue