From 15b25b5afba329717a1ab608a3d17fb234bf1c3c Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Wed, 5 Jun 2024 16:59:33 +0200 Subject: [PATCH] Fix searching in the divergence (left/right) view Searching in the "Divergence from upstream" view would select the wrong lines. The OnSearchSelect function gets passed a view index, and uses it to select a model line. In most views these are the same, but not in the divergence view (because of the Remote/Local section headers). --- pkg/gui/context/list_context_trait.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gui/context/list_context_trait.go b/pkg/gui/context/list_context_trait.go index eb738e332..c0e5ca04f 100644 --- a/pkg/gui/context/list_context_trait.go +++ b/pkg/gui/context/list_context_trait.go @@ -102,7 +102,7 @@ func (self *ListContextTrait) HandleRender() error { } func (self *ListContextTrait) OnSearchSelect(selectedLineIdx int) error { - self.GetList().SetSelection(selectedLineIdx) + self.GetList().SetSelection(self.ViewIndexToModelIndex(selectedLineIdx)) return self.HandleFocus(types.OnFocusOpts{}) }