From 035344054768562bee7db12e02e3bec1c8409210 Mon Sep 17 00:00:00 2001 From: citrons Date: Mon, 2 Jun 2025 17:38:27 -0500 Subject: window history --- client/ui.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'client/ui.go') diff --git a/client/ui.go b/client/ui.go index f3a79c6..014c7e9 100644 --- a/client/ui.go +++ b/client/ui.go @@ -22,11 +22,15 @@ func (a *application) pushPrompt(p window.Prompt) { func (a *application) removePrompt(p window.Prompt) { for i := len(a.prompts) - 1; i >= 0; i-- { + if p != a.prompts[i] { + continue + } if i < len(a.prompts) - 1 { a.prompts = append(a.prompts[:i], a.prompts[i + 1:]...) } else { a.prompts = a.prompts[:i] } + break } } @@ -63,8 +67,12 @@ func (a *application) onInput(ev tui.Event) { input.SetText("") } } + case 'p' | keys.Ctrl: + a.traverseHistory(-1) + case 'n' | keys.Ctrl: + a.traverseHistory(1) case '0' | keys.Alt: - a.currentWindow = cmdWindowLocation {} + a.goTo(cmdWindowLocation{}) } } -- cgit v1.2.3