diff --git a/pkg/gui/context/commit_files_context.go b/pkg/gui/context/commit_files_context.go index 7af968fb7..88dac8b45 100644 --- a/pkg/gui/context/commit_files_context.go +++ b/pkg/gui/context/commit_files_context.go @@ -64,10 +64,7 @@ func NewCommitFilesContext(c *ContextCommon) *CommitFilesContext { }, } - ctx.GetView().SetOnSelectItem(ctx.SearchTrait.onSelectItemWrapper(func(selectedLineIdx int) error { - ctx.GetList().SetSelection(selectedLineIdx) - return ctx.HandleFocus(types.OnFocusOpts{}) - })) + ctx.GetView().SetOnSelectItem(ctx.SearchTrait.onSelectItemWrapper(ctx.OnSearchSelect)) return ctx } diff --git a/pkg/gui/context/local_commits_context.go b/pkg/gui/context/local_commits_context.go index d3fc6e240..0458c401b 100644 --- a/pkg/gui/context/local_commits_context.go +++ b/pkg/gui/context/local_commits_context.go @@ -85,10 +85,7 @@ func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext { }, } - ctx.GetView().SetOnSelectItem(ctx.SearchTrait.onSelectItemWrapper(func(selectedLineIdx int) error { - ctx.GetList().SetSelection(selectedLineIdx) - return ctx.HandleFocus(types.OnFocusOpts{}) - })) + ctx.GetView().SetOnSelectItem(ctx.SearchTrait.onSelectItemWrapper(ctx.OnSearchSelect)) return ctx } diff --git a/pkg/gui/context/sub_commits_context.go b/pkg/gui/context/sub_commits_context.go index f540dba87..c4f2e318e 100644 --- a/pkg/gui/context/sub_commits_context.go +++ b/pkg/gui/context/sub_commits_context.go @@ -133,10 +133,7 @@ func NewSubCommitsContext( }, } - ctx.GetView().SetOnSelectItem(ctx.SearchTrait.onSelectItemWrapper(func(selectedLineIdx int) error { - ctx.GetList().SetSelection(selectedLineIdx) - return ctx.HandleFocus(types.OnFocusOpts{}) - })) + ctx.GetView().SetOnSelectItem(ctx.SearchTrait.onSelectItemWrapper(ctx.OnSearchSelect)) return ctx } diff --git a/pkg/gui/context/working_tree_context.go b/pkg/gui/context/working_tree_context.go index 6fa462cb1..4f7bfabff 100644 --- a/pkg/gui/context/working_tree_context.go +++ b/pkg/gui/context/working_tree_context.go @@ -51,10 +51,7 @@ func NewWorkingTreeContext(c *ContextCommon) *WorkingTreeContext { }, } - ctx.GetView().SetOnSelectItem(ctx.SearchTrait.onSelectItemWrapper(func(selectedLineIdx int) error { - ctx.GetList().SetSelection(selectedLineIdx) - return ctx.HandleFocus(types.OnFocusOpts{}) - })) + ctx.GetView().SetOnSelectItem(ctx.SearchTrait.onSelectItemWrapper(ctx.OnSearchSelect)) return ctx }