diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-06-05 16:59:33 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-06-23 11:43:12 +0200 |
commit | 15b25b5afba329717a1ab608a3d17fb234bf1c3c (patch) | |
tree | 378794f19356e3e01a3179e7c9177a393ca29840 | |
parent | 27ad75de161af79c2a87a2a4a647b1cef0ba77e1 (diff) |
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).
-rw-r--r-- | pkg/gui/context/list_context_trait.go | 2 |
1 files changed, 1 insertions, 1 deletions
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{}) } |