Skip to content

Commit

Permalink
fix: remove -E from zparseopts (Aloxaf#433)
Browse files Browse the repository at this point in the history
* fix: remove -E from zparseopts

this fix following bugs:

_tst() {
  compadd -J packages -X package openpgp-keys-gentoo-release -MERGING-pnpm-bin
}
compdef _tst tst

* fix: tests
  • Loading branch information
Aloxaf authored Apr 26, 2024
1 parent cf3c151 commit c7fb028
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fzf-tab.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ builtin unalias -m '[^+]*'
# parse all options
local -A apre hpre dscrs _oad _mesg
local -a isfile _opts __ expl
zparseopts -E -a _opts P:=apre p:=hpre d:=dscrs X+:=expl O:=_oad A:=_oad D:=_oad f=isfile \
zparseopts -a _opts P:=apre p:=hpre d:=dscrs X+:=expl O:=_oad A:=_oad D:=_oad f=isfile \
i: S: s: I: x:=_mesg r: R: W: F: M+: E: q e Q n U C \
J:=__ V:=__ a=__ l=__ k=__ o=__ 1=__ 2=__
J:=__ V:=__ a=__ l=__ k=__ o::=__ 1=__ 2=__

# store $curcontext for further usage
_ftb_curcontext=${curcontext#:}
Expand Down
8 changes: 8 additions & 0 deletions test/fzftab.ztst
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@
>C1:{prefix_2}
>C1:{prenofix_3}

comptesteval '_tst() { compadd -J packages -X package openpgp-keys-gentoo-release -MERGING-pnpm-bin }'
comptest $'tst \t'
0:completions starts with dash
>line: {tst }{}
>QUERY:{}
>C1:{package }
>C1:{openpgp-keys-gentoo-release}
>C1:{-MERGING-pnpm-bin}
%clean

zmodload -ui zsh/zpty
Expand Down

0 comments on commit c7fb028

Please sign in to comment.