Skip to content

Commit

Permalink
Ensure default tab style is complete-word
Browse files Browse the repository at this point in the history
Fixes a bug introduced by 7b1a81c.
  • Loading branch information
marlonrichert committed Oct 28, 2021
1 parent 3f357fc commit efc951d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/.autocomplete.key-binding
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ zmodload -F zsh/parameter p:funcstack p:functions
builtin zstyle ':autocomplete:shift-tab:*' insert-unambiguous yes

local tab_style=
builtin zstyle -s :autocomplete:tab: widget-style tab_style ||
tab_style='complete-word'
if ! builtin zstyle -s :autocomplete:tab: widget-style tab_style; then
tab_style='complete-word'
builtin zstyle ':autocomplete:tab:*' widget-style $tab_style
fi

if builtin zstyle -t :autocomplete:tab: fzf-completion &&
[[ -v functions[fzf-completion] ]]; then
Expand All @@ -35,8 +37,10 @@ zmodload -F zsh/parameter p:funcstack p:functions
fi

local backtab_style=
builtin zstyle -s :autocomplete:shift-tab: widget-style backtab_style ||
backtab_style=${tab_style:/menu-complete/reverse-menu-complete}
if ! builtin zstyle -s :autocomplete:shift-tab: widget-style backtab_style; then
backtab_style=${tab_style:/menu-complete/reverse-menu-complete}
builtin zstyle ':autocomplete:shift-tab:*' widget-style $backtab_style
fi

builtin bindkey -M emacs $terminfo[kcbt] $backtab_style
builtin bindkey -M viins $terminfo[kcbt] $backtab_style
Expand Down

0 comments on commit efc951d

Please sign in to comment.