summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-06-05 16:59:33 +0200
committerStefan Haller <stefan@haller-berlin.de>2024-06-23 11:43:12 +0200
commit15b25b5afba329717a1ab608a3d17fb234bf1c3c (patch)
tree378794f19356e3e01a3179e7c9177a393ca29840 /pkg
parent27ad75de161af79c2a87a2a4a647b1cef0ba77e1 (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).
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/context/list_context_trait.go2
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{})
}