From edec116cebe6dde1f8e7ce375fabc407c84d92b5 Mon Sep 17 00:00:00 2001 From: Karim Khaleel Date: Fri, 4 Aug 2023 14:01:30 +0300 Subject: Add search history Add search history for filterable and searchable views. --- pkg/gui/types/context.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkg/gui/types/context.go') diff --git a/pkg/gui/types/context.go b/pkg/gui/types/context.go index dca5b042c..e06138a99 100644 --- a/pkg/gui/types/context.go +++ b/pkg/gui/types/context.go @@ -4,6 +4,7 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/gui/patch_exploring" + "github.com/jesseduffield/lazygit/pkg/utils" "github.com/sasha-s/go-deadlock" ) @@ -87,9 +88,16 @@ type Context interface { HandleRenderToMain() error } +type ISearchHistoryContext interface { + Context + + GetSearchHistory() *utils.HistoryBuffer[string] +} + type IFilterableContext interface { Context IListPanelState + ISearchHistoryContext SetFilter(string) GetFilter() string @@ -100,6 +108,7 @@ type IFilterableContext interface { type ISearchableContext interface { Context + ISearchHistoryContext SetSearchString(string) GetSearchString() string -- cgit v1.2.3