8000 DiffHeader's highlight `NeogitDiffHeaderHighlight` could never be updated · Issue #1710 · NeogitOrg/neogit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
DiffHeader's highlight NeogitDiffHeaderHighlight could never be updated #1710
Open
@SheffeyG

Description

@SheffeyG

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:

  1. scale up the update range to the whole Diff.
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0