mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Add search history
Add search history for filterable and searchable views.
This commit is contained in:
20
pkg/gui/context/history_trait.go
Normal file
20
pkg/gui/context/history_trait.go
Normal file
@ -0,0 +1,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
|
||||
}
|
Reference in New Issue
Block a user