Description
Description
In commit view, we have something like:
1 DiffHeader
2 HunkHeader1
3 ...
4 HunkHeader2
5 ...
As the documents said, when we navigate to DiffHeader, it's highlight is NeogitDiffHeaderCursor
, and if we enter into HunkHeader1, the DiffHeader's hl should be NeogitDiffHeaderHighlight
cause we are inside DiffHeader now, that make sense.
But the hl of DiffHeader would never be updated to NeogitDiffHeaderHighlight
, it will always be NeogitDiffHeaderCursor
, because once we enter into HunkHeader1, our update area would be line 2 ~ 3
so we never update the 1st DiffHeader.
I've tried simply change the update lines area as:
- local start = math.max(context.position.row_start, fn.line("w0"))
+ local start = math.max(context.position.row_start - 1, fn.line("w0"))
but this dirty fix could invole other views, and that can't fix the situation when we go into HunkHeader2.
So the real fix could be:
- scale up the update range to the whole Diff.
- update the DiffHeader additinally after we enter/exit a Hunk.
What's your opinion? @CKolkey
BTW, in our default config we have a NeogitDiffHeaderHighlight
but no NeogitDiffHeaderCursor
now, so it's always default text when we put cursor to that line.
Neovim version
nvim-0.11.0
Operating system and version
ubuntu 22.04
Steps to reproduce
open a commit view
Expected behavior
as above
Actual behavior
as above
Minimal config
all is default