summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context/history_trait.go
blob: f850a3b774cddc698370e9b805fb52e654feb0a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package context

import (
	"github.com/jesseduffield/lazygit/pkg/utils"
)

// Maintains a list of strings that have previously been searched/filtered for
type SearchHistory struct {
	history *utils.HistoryBuffer[string]
}

func NewSearchHistory() *SearchHistory {
	return &SearchHistory{
		history: utils.NewHistoryBuffer[string](1000),
	}
}

func (self *SearchHistory) GetSearchHistory() *utils.HistoryBuffer[string] {
	return self.history
}