-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7727d97
commit 5d64d38
Showing
1 changed file
with
29 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
#!/bin/zsh | ||
emulate -L zsh | ||
setopt $_autocomplete__func_opts[@] | ||
typeset -gH _autocomplete__last_widget= | ||
|
||
# If no arg, assume same widget as last time. | ||
[[ -v 1 && -n $1 ]] && | ||
typeset -gH _autocomplete__last_widget="$1" | ||
.autocomplete.zle-flags() { | ||
emulate -L zsh | ||
setopt $_autocomplete__func_opts[@] | ||
|
||
# Return 0 to continue, 1 to abort. | ||
case $_autocomplete__last_widget in | ||
( *kill-*~vi-* ) | ||
builtin zle -f kill | ||
return 0 | ||
;; | ||
( *yank*~vi-* | vi-*put-*after | bracketed-paste ) | ||
builtin zle -f yank | ||
return 1 | ||
;; | ||
( vi-*put-*before ) | ||
builtin zle -f yankbefore | ||
return 1 | ||
;; | ||
( * ) | ||
return 0 | ||
;; | ||
esac | ||
# If no arg, assume same widget as last time. | ||
[[ -v 1 && -n $1 ]] && | ||
typeset -gH _autocomplete__last_widget="$1" | ||
|
||
# Return 0 to continue, 1 to abort. | ||
case $_autocomplete__last_widget in | ||
( *kill-*~vi-* ) | ||
builtin zle -f kill | ||
return 0 | ||
;; | ||
( *yank*~vi-* | vi-*put-*after | bracketed-paste ) | ||
builtin zle -f yank | ||
return 1 | ||
;; | ||
( vi-*put-*before ) | ||
builtin zle -f yankbefore | ||
return 1 | ||
;; | ||
( * ) | ||
return 0 | ||
;; | ||
esac | ||
} | ||
|
||
.autocomplete.zle-flags "$@" |