"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: tog: keymaps to navigate to prev/next file/hunk in the diff
To:
Mark Jamsek <mark@jamsek.com>
Cc:
gameoftrees@openbsd.org
Date:
Tue, 26 Jul 2022 14:24:24 +0200

Download raw body.

Thread
On Tue, Jul 26, 2022 at 01:51:02AM +1000, Mark Jamsek wrote:
> I think that would be a lot better! Tbh, my first instinct was that this
> should be done in the diff code because we already know each line type
> as the diff is produced, but I wasn't sure how the proposed key maps
> would be received so wanted to get a feel first.
> 
> I'm happy to hack on the diff code. We could use a bitarray or even
> build an index of each line as we save offsets so we'd have the type of
> each line in the diff. Then we could do away with the regex for colours
> as we'd have each meta/hunk/' '/+/- line indexed. What do you think? Or
> would you prefer we just have another array for hunk offsets? I don't
> mind either way.

Sounds good. The more meta-data we can get from the diff library
"for free", the better. Callers should ideally not have to munge
the data again to figure out what is where.