diffs.nvim/lua/diffs
Barrett Ruth 749a21ae3c
fix: clear stale gutter extmarks after fugitive section toggle (#139)
## Problem

Repeatedly toggling `=` in fugitive left green gutter
(`number_hl_group`)
extmarks on lines between sections. When fugitive collapses a diff
section,
Neovim compresses extmarks from deleted lines onto the next surviving
line
(the `M ...` file entry). Two issues prevented cleanup:

1. `carry_forward_highlighted` returned `{}` (truthy in Lua) when zero
hunks
matched, so `pending_clear` stayed `false` and the compressed extmarks
   were never cleared.
2. The `nvim_buf_clear_namespace` call in `on_buf`'s `pending_clear`
path was
removed in 2feb8a8, so even when `pending_clear` was `true` the extmarks
   survived.

## Solution

Return `nil` from `carry_forward_highlighted` when no hunks were carried
forward (`next(highlighted) == nil`), so `pending_clear` is correctly
set to
`true`. Restore `nvim_buf_clear_namespace` in `on_buf`'s `pending_clear`
block. Add `process_pending_clear` test helper and spec coverage.
2026-02-25 13:20:59 -05:00
..
commands.lua feat: unified diff conflict resolution for unmerged files (#99) 2026-02-09 12:21:13 -05:00
conflict.lua fix: pre-release cleanup for v0.2.0 (#102) 2026-02-09 15:08:36 -05:00
debug.lua fix(debug): resolve sparse array crash in json dump 2026-02-07 00:50:02 -05:00
diff.lua fix(diff): strip linematch from char-level diff 2026-02-07 00:50:08 -05:00
fugitive.lua fix: pre-release cleanup for v0.2.0 (#102) 2026-02-09 15:08:36 -05:00
git.lua perf: cache repo root and harden async paths (#100) 2026-02-09 12:39:13 -05:00
health.lua feat(highlight): add character-level intra-line diff highlighting 2026-02-06 13:53:58 -05:00
highlight.lua fix(highlight): revert line backgrounds to hl_group+hl_eol (#124) 2026-02-15 18:27:39 -05:00
init.lua fix: clear stale gutter extmarks after fugitive section toggle (#139) 2026-02-25 13:20:59 -05:00
lib.lua perf: cache repo root and harden async paths (#100) 2026-02-09 12:39:13 -05:00
log.lua performance improvements (#116) 2026-02-12 16:59:13 -05:00
merge.lua fix: pre-release cleanup for v0.2.0 (#102) 2026-02-09 15:08:36 -05:00
parser.lua feat(neogit): use new neogit apis for highlight and repo root (#133) 2026-02-25 11:42:59 -05:00