Skip to content

Commit

Permalink
perf(mutt): return earlier on empty cur
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga authored and scop committed Jan 3, 2024
1 parent 5330fbe commit a244587
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions completions/mutt
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ _comp_cmd_mutt__aliases()
# @param $1 (cur) Current word to complete
_comp_cmd_mutt__query()
{
local cur=$1 querycmd muttcmd=${words[0]}
local cur=$1
[[ $cur ]] || return 0
local querycmd muttcmd=${words[0]}
local -a queryresults

querycmd="$("$muttcmd" -Q query_command 2>/dev/null | command sed -e 's|^query_command=\"\(.*\)\"$|\1|' -e 's|%s|'"$cur"'|')"
if [[ $cur && $querycmd ]]; then
if [[ $querycmd ]]; then
local REPLY
_comp_expand_tilde "$querycmd"
querycmd=$REPLY
Expand Down

0 comments on commit a244587

Please sign in to comment.