Skip to content

Commit

Permalink
Fix a bug with menu widgets & partial lists
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonrichert committed Jul 17, 2021
1 parent 5cd54a0 commit 24e2350
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions completion/_autocomplete.unambiguous
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ fi

local tag=unambiguous
_tags $tag
_tags && _requested $tag &&
_message -e unambiguous \
$'%{\e[1;2;39m%}common substring:%b %F{0}%K{11}'"$compstate[unambiguous]%f%k"
# \e[2m = faint; 0 = black; 11 = bright yellow
_tags && _requested $tag && _message -e unambiguous \
$'%{\e[1;2;39m%}common substring:%b %F{0}%K{11}'"$compstate[unambiguous]%f%k"
# \e[2m = faint; 0 = black; 11 = bright yellow
4 changes: 1 addition & 3 deletions module/.autocomplete.async
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,8 @@ zle -N history-incremental-search-forward .autocomplete.async.history-incrementa
}

.autocomplete.async.list-choices.post() {
if [[ -v _autocomplete__partial_list ]]; then
[[ -v _autocomplete__partial_list ]] &&
compadd -J -last- -x '%F{black}%K{14}(MORE)%f%k'
unset _autocomplete__partial_list
fi
compstate[insert]=
unset MENUSELECT MENUMODE
}
Expand Down
1 change: 1 addition & 0 deletions module/.autocomplete.compinit
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ EOF
.autocomplete.patch _main_complete
_main_complete() {
local -i ret=1 _autocomplete__reserved_lines=0
unset _autocomplete__partial_list

compstate[insert]=menu # To get the best output from `_expand` (and some other functions).
compstate[last_prompt]=yes # Completion doesn't stay on the same command line without this.
Expand Down
2 changes: 1 addition & 1 deletion widget/.autocomplete.complete-word.completion-widget
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ builtin autoload -Uz .autocomplete.complete-word.post

local +h curcontext=${curcontext:-${WIDGET}:::}
local +h -a comppostfuncs=( .autocomplete.complete-word.post "$comppostfuncs[@]" )
if [[ $WIDGET == *menu-* ]] ||
if [[ $WIDGET == *menu-* && -v _autocomplete__partial_list ]] ||
( ( [[ "$KEYS" == "$key[Shift-Tab]" ]] ||
zstyle -t ":autocomplete:${(kL)key[(Re)$KEYS]}:" insert-unambiguous
) && [[
Expand Down

0 comments on commit 24e2350

Please sign in to comment.