performance improvements (#116)

closes #111
This commit is contained in:
Barrett Ruth 2026-02-12 16:59:13 -05:00 committed by GitHub
parent 330e2bc9b8
commit 9a0b812f69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 590 additions and 104 deletions

View file

@ -52,7 +52,6 @@ Configuration is done via `vim.g.diffs`. Set this before the plugin loads:
>lua
vim.g.diffs = {
debug = false,
debounce_ms = 0,
hide_prefix = false,
highlights = {
background = true,
@ -109,11 +108,6 @@ Configuration is done via `vim.g.diffs`. Set this before the plugin loads:
Enable debug logging to |:messages| with
`[diffs]` prefix.
{debounce_ms} (integer, default: 0)
Debounce delay in milliseconds for re-highlighting
after buffer changes. Lower values feel snappier
but use more CPU.
{hide_prefix} (boolean, default: false)
Hide diff prefixes (`+`/`-`/` `) using virtual
text overlay. Makes code appear without the
@ -611,7 +605,7 @@ Summary / commit detail views: ~
priority 201 overlay changed characters with an intense background
- Conceal extmarks hide diff prefixes when `hide_prefix` is enabled
- All priorities are configurable via |diffs.PrioritiesConfig|
4. Re-highlighting occurs on `TextChanged` (debounced) and `Syntax` events
4. A decoration provider re-highlights visible hunks on each redraw
Diff mode views: ~
1. `OptionSet diff` detects when any window enters diff mode
@ -637,14 +631,8 @@ the buffer briefly shows fugitive's default diff highlighting before
diffs.nvim applies treesitter highlights.
This occurs because diffs.nvim hooks into the `FileType fugitive` event,
which fires after vim-fugitive has already painted the buffer. Even with
`debounce_ms = 0`, the re-painting goes through Neovim's event loop.
To minimize the flash, use a low debounce value: >lua
vim.g.diffs = {
debounce_ms = 0,
}
<
which fires after vim-fugitive has already painted the buffer. The
decoration provider applies highlights on the next redraw cycle.
Conflicting Diff Plugins ~
*diffs-plugin-conflicts*