Skip to content

Commit

Permalink
Add tag: ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloxaf committed Mar 10, 2020
1 parent 17ff089 commit 56adfa4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Replace zsh's default completion selection menu with fzf!
- [command](#command)
- [extra-opts](#extra-opts)
- [continuous-trigger](#continuous-trigger)
- [ignore](#ignore)
- [fake-compadd](#fake-compadd)
- [insert-space](#insert-space)
- [query-string](#query-string)
Expand Down Expand Up @@ -167,6 +168,12 @@ The key to trigger a continuous completion. It's useful when complete a long pat

Default value: `zstyle ':fzf-tab:*' continuous-trigger '/'`

### ignore

Don't active fzf-tab in this context.

Default value: `zstyle ':fzf-tab:*' ignore false`

### fake-compadd

How to do a fake compadd. This only affects the result of multiple selections.
Expand Down
7 changes: 7 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [command](#command)
- [extra-opts](#extra-opts)
- [continuous-trigger](#continuous-trigger)
- [ignore](#ignore)
- [fake-compadd](#fake-compadd)
- [insert-space](#insert-space)
- [query-string](#query-string)
Expand Down Expand Up @@ -162,6 +163,12 @@ command 的额外参数

默认值:`zstyle ':fzf-tab:*' continuous-trigger '/'`

### ignore

当前 context 下不要使用 fzf-tab

默认值:`zstyle ':fzf-tab:*' ignore false`

### fake-compadd

如何伪造 compadd。这项只会影响选择多个候选项时的结果。
Expand Down
4 changes: 3 additions & 1 deletion fzf-tab.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ compadd() {
J:=__ V:=__ a=__ l=__ k=__ o=__ 1=__ 2=__

# just delegate and leave if any of -O, -A or -D are given or fzf-tab is not enabled
if (( $#_oad != 0 || ! IN_FZF_TAB )); then
zstyle -t ":fzf-tab:${curcontext#:}" ignore
if (( $#_oad != 0 || ! IN_FZF_TAB || ! $? )); then
builtin compadd "$@"
return
fi
Expand Down Expand Up @@ -125,6 +126,7 @@ _fzf_tab_get() {
_fzf_tab_add_default extra-opts ''
_fzf_tab_add_default no-group-color ${FZF_TAB_NO_GROUP_COLOR:-$'\033[37m'}
_fzf_tab_add_default group-colors $FZF_TAB_GROUP_COLORS
_fzf_tab_add_default ignore false

if zstyle -m ':completion:*:descriptions' format '*'; then
_fzf_tab_add_default prefix '·'
Expand Down

0 comments on commit 56adfa4

Please sign in to comment.