Handle wrapped lines in patch explorer state

So far, lines in the view corresponded 1:1 to lines in the patch. Once we turn
on wrapping for the staging view (which we don't do yet), this is no longer
true, so we need to convert from view lines to patch lines or vice versa all
over the place.
This commit is contained in:
Stefan Haller 2024-11-10 20:00:58 +01:00
parent b7444b9a49
commit 5213a9de32
7 changed files with 64 additions and 30 deletions

View file

@ -91,7 +91,7 @@ func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpt
oldState := context.GetState()
state := patch_exploring.NewState(diff, selectedLineIdx, oldState)
state := patch_exploring.NewState(diff, selectedLineIdx, context.GetView(), oldState)
context.SetState(state)
if state == nil {
self.Escape()