summaryrefslogtreecommitdiff
path: root/plugins/globalias
diff options
context:
space:
mode:
authorPatrick W. Healy <phealy@phealy.com>2020-10-14 09:57:59 -0500
committerGitHub <noreply@github.com>2020-10-14 16:57:59 +0200
commite75aa2875eea94fcf7ceb3f246db96cc3bc61a2e (patch)
tree083f1b219f9f0b024075c50c8417e8b9cc590bf5 /plugins/globalias
parent568a977d2076b4210a9a925c53abcf0a831e4003 (diff)
downloadzsh-e75aa2875eea94fcf7ceb3f246db96cc3bc61a2e.tar.gz
zsh-e75aa2875eea94fcf7ceb3f246db96cc3bc61a2e.tar.bz2
zsh-e75aa2875eea94fcf7ceb3f246db96cc3bc61a2e.zip
globalias: expand filtering to anywhere in the command (#9338)
Diffstat (limited to 'plugins/globalias')
-rw-r--r--plugins/globalias/globalias.plugin.zsh4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/globalias/globalias.plugin.zsh b/plugins/globalias/globalias.plugin.zsh
index f8c07ce43..d4d40c863 100644
--- a/plugins/globalias/globalias.plugin.zsh
+++ b/plugins/globalias/globalias.plugin.zsh
@@ -1,5 +1,7 @@
globalias() {
- if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$LBUFFER] -eq 0 ]]; then
+ # Get last word to the left of the cursor
+ local word=${${(A)=LBUFFER}[-1]}
+ if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$word] -eq 0 ]]; then
zle _expand_alias
zle expand-word
fi