mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-02 09:21:40 +02:00
edec116ceb
Add search history for filterable and searchable views.
21 lines
443 B
Go
21 lines
443 B
Go
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
|
|
}
|