From 8edad826caf2fa48bfad33f9f8c4f3ba49a052da Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 30 Dec 2022 23:24:24 +1100 Subject: Begin refactoring gui This begins a big refactor of moving more code out of the Gui struct into contexts, controllers, and helpers. We also move some code into structs in the gui package purely for the sake of better encapsulation --- pkg/gui/searching.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pkg/gui/searching.go') diff --git a/pkg/gui/searching.go b/pkg/gui/searching.go index a8580655c..270fe1efd 100644 --- a/pkg/gui/searching.go +++ b/pkg/gui/searching.go @@ -48,7 +48,7 @@ func (gui *Gui) onSelectItemWrapper(innerFunc func(int) error) func(int, int, in return func(y int, index int, total int) error { if total == 0 { - return gui.renderString( + gui.c.SetViewContent( gui.Views.Search, fmt.Sprintf( "no matches for '%s' %s", @@ -56,8 +56,9 @@ func (gui *Gui) onSelectItemWrapper(innerFunc func(int) error) func(int, int, in theme.OptionsFgColor.Sprintf("%s: exit search mode", keybindings.Label(keybindingConfig.Universal.Return)), ), ) + return nil } - _ = gui.renderString( + gui.c.SetViewContent( gui.Views.Search, fmt.Sprintf( "matches for '%s' (%d of %d) %s", -- cgit v1.2.3