diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-05-27 14:14:43 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-03 12:54:13 +1000 |
commit | a9e2c8129f6e1cdfd58446d7ce5080fcabc2ea04 (patch) | |
tree | 272c6f737052d6e06f71c6e1e9ce355410238f1a /pkg/gui/editors.go | |
parent | fd861826bc11754caf4ee4651dbadf9544792d1f (diff) |
Introduce filtered list view model
We're going to start supporting filtering of list views
Diffstat (limited to 'pkg/gui/editors.go')
-rw-r--r-- | pkg/gui/editors.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/gui/editors.go b/pkg/gui/editors.go index 1fbba2aad..b095630ec 100644 --- a/pkg/gui/editors.go +++ b/pkg/gui/editors.go @@ -89,3 +89,14 @@ func (gui *Gui) promptEditor(v *gocui.View, key gocui.Key, ch rune, mod gocui.Mo return matched } + +func (gui *Gui) searchEditor(v *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier) bool { + matched := gui.handleEditorKeypress(v.TextArea, key, ch, mod, false) + v.RenderTextArea() + + searchString := v.TextArea.GetContent() + + gui.helpers.Search.OnPromptContentChanged(searchString) + + return matched +} |