summaryrefslogtreecommitdiff
path: root/internal/tui/keys.go
diff options
context:
space:
mode:
authorT <t@tjp.lol>2025-08-13 14:47:24 -0600
committerT <t@tjp.lol>2025-08-13 14:47:55 -0600
commitd6781f3e5b431057c23b2deaa943f273699e37f5 (patch)
tree269ef61bc44750881068ebd94d643a9b3a57c20c /internal/tui/keys.go
parent389b72e55b04ccfc02b04eb81cb8f7bb7a5c8b59 (diff)
client and project modal field suggestions, ctrl+n to accept
Diffstat (limited to 'internal/tui/keys.go')
-rw-r--r--internal/tui/keys.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/internal/tui/keys.go b/internal/tui/keys.go
index c2f2271..3a7242d 100644
--- a/internal/tui/keys.go
+++ b/internal/tui/keys.go
@@ -164,6 +164,16 @@ var Bindings map[KeyBindingScope]map[string]KeyBinding = map[KeyBindingScope]map
Description: func(AppModel) string { return "Filter" },
Result: func(*AppModel) tea.Cmd { return createHistoryFilterModal() },
},
+ "g": KeyBinding{
+ Key: "g",
+ Description: func(AppModel) string { return "Top" },
+ Result: func(*AppModel) tea.Cmd { return changeSelectionToTop() },
+ },
+ "G": KeyBinding{
+ Key: "G",
+ Description: func(AppModel) string { return "Bottom" },
+ Result: func(*AppModel) tea.Cmd { return changeSelectionToBottom() },
+ },
},
ScopeHistoryBoxDetails: {
"j": KeyBinding{
@@ -214,6 +224,16 @@ var Bindings map[KeyBindingScope]map[string]KeyBinding = map[KeyBindingScope]map
Result: func(*AppModel) tea.Cmd { return backToHistorySummary() },
Hide: true,
},
+ "g": KeyBinding{
+ Key: "g",
+ Description: func(AppModel) string { return "Top" },
+ Result: func(*AppModel) tea.Cmd { return changeSelectionToTop() },
+ },
+ "G": KeyBinding{
+ Key: "G",
+ Description: func(AppModel) string { return "Bottom" },
+ Result: func(*AppModel) tea.Cmd { return changeSelectionToBottom() },
+ },
},
ScopeModal: {
"enter": KeyBinding{
@@ -231,6 +251,23 @@ var Bindings map[KeyBindingScope]map[string]KeyBinding = map[KeyBindingScope]map
Description: func(AppModel) string { return "Close" },
Result: func(*AppModel) tea.Cmd { return closeModal() },
},
+ "ctrl+n": KeyBinding{
+ Key: "Ctrl+n",
+ Description: func(m AppModel) string {
+ if m.modalBox.form.fields[m.modalBox.form.selIdx].suggestions == noSuggestions {
+ return ""
+ } else {
+ return "Accept Suggestion"
+ }
+ },
+ Result: func(m *AppModel) tea.Cmd {
+ field := &m.modalBox.form.fields[m.modalBox.form.selIdx]
+ sugg := field.CurrentSuggestion()
+ field.SetValue(sugg)
+ field.CursorEnd()
+ return nil
+ },
+ },
},
}