Skip to content

Commit

Permalink
Change minibuffer clear function to clear-packets
Browse files Browse the repository at this point in the history
This disambiguates it from clear-filter.
  • Loading branch information
gcla committed Dec 30, 2020
1 parent b6d59cd commit ab0e8d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}))
Expand Down
4 changes: 2 additions & 2 deletions widgets/minibuffer/minibuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ab0e8d6

Please sign in to comment.