From ab0e8d63abe4ca75b8654896b21a78c38cb75fcb Mon Sep 17 00:00:00 2001 From: Graham Clark Date: Wed, 30 Dec 2020 12:41:31 -0500 Subject: [PATCH] Change minibuffer clear function to clear-packets This disambiguates it from clear-filter. --- ui/ui.go | 2 +- widgets/minibuffer/minibuffer.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/ui.go b/ui/ui.go index e5dcefd..dcf1a9e 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -1048,7 +1048,7 @@ func lastLineMode(app gowid.IApp) { return nil })) - MiniBuffer.Register("clear", minibufferFn(func(gowid.IApp, ...string) error { + MiniBuffer.Register("clear-packets", minibufferFn(func(gowid.IApp, ...string) error { reallyClear(app) return nil })) diff --git a/widgets/minibuffer/minibuffer.go b/widgets/minibuffer/minibuffer.go index d5483a0..02bb60b 100644 --- a/widgets/minibuffer/minibuffer.go +++ b/widgets/minibuffer/minibuffer.go @@ -245,7 +245,7 @@ func (w *Widget) handleSelection(keyIsEnter bool, app gowid.IApp) { case len(words) == 1: // command itself may be partially provided. If there is only // one way for the command to be completed, allow it to be run. - // User types "cl", partials would be ["clear", "clear-filter"] + // User types "cl", partials would be ["clear-packets", "clear-filter"] partials := w.getPartialsCompletions(false, app) switch len(partials) { case 0: @@ -294,7 +294,7 @@ func (w *Widget) handleSelection(keyIsEnter bool, app gowid.IApp) { extraPrefix += string(c) } longestPrefixPartial := partials[selectedIdx] - // e.g. "cl" + "ear-" from ["clear", "clear-filter"] + // e.g. "cl" + "ear-" from ["clear-packets", "clear-filter"] longestPrefixPartial.qword = words[len(words)-1] + extraPrefix w.ed.SetText(longestPrefixPartial.Line(), app) w.ed.SetCursorPos(longestPrefixPartial.CursorPos(), app)