summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorcitrons <citrons@mondecitronne.com>2025-06-05 19:51:00 -0500
committercitrons <citrons@mondecitronne.com>2025-06-07 16:02:18 -0500
commit81d7512479f01e5b22a26967642dd7951369bd65 (patch)
tree017d116f8d0a073e9aa865dd29ec02605be519fe /client
parent1c3bc122c47d71d00a5d452bf9032ef6b4af67e5 (diff)
ctrl+l to clear command window preview
Diffstat (limited to 'client')
-rw-r--r--client/cmd_window.go13
-rw-r--r--client/ui.go2
2 files changed, 15 insertions, 0 deletions
diff --git a/client/cmd_window.go b/client/cmd_window.go
index 0a76e25..b1435be 100644
--- a/client/cmd_window.go
+++ b/client/cmd_window.go
@@ -138,3 +138,16 @@ func (w *cmdWindow) cmd(f string, a ...any) {
lastIndex++
w.Buf.Add(logMsg {lastIndex, fmt.Sprintf(f, a...), logCmd})
}
+
+type clearPreviewMsg int
+
+func (c clearPreviewMsg) Id() string {
+ return fmt.Sprintf("clear.%d", int(c))
+}
+
+func (c clearPreviewMsg) Show(bool) {}
+
+func (w *cmdWindow) clearPreview() {
+ lastIndex++
+ w.Buf.Add(clearPreviewMsg(lastIndex))
+}
diff --git a/client/ui.go b/client/ui.go
index 50e7790..ab5e190 100644
--- a/client/ui.go
+++ b/client/ui.go
@@ -107,6 +107,8 @@ func (a *application) onInput(ev tui.Event) {
case '0' | keys.Alt:
a.goTo(cmdWindowLocation{})
+ case 'l' | keys.Ctrl:
+ a.cmdWindow.clearPreview()
}
}