53cbd658f5ae6874af0d804cee6748dfba69e786

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

globalias: use ${(z)var} to split into words using shell parsing

Diff

 1diff --git a/plugins/globalias/globalias.plugin.zsh b/plugins/globalias/globalias.plugin.zsh
 2index d4d40c863b75533b08137232635c6cbd514bf75e..bd27d589d3b28fe45293a3887b17b0b226e28922 100644
 3--- a/plugins/globalias/globalias.plugin.zsh
 4+++ b/plugins/globalias/globalias.plugin.zsh
 5@@ -1,6 +1,8 @@
 6 globalias() {
 7-   # Get last word to the left of the cursor
 8-   local word=${${(A)=LBUFFER}[-1]}
 9+   # Get last word to the left of the cursor:
10+   # (z) splits into words using shell parsing
11+   # (A) makes it an array even if there's only one element
12+   local word=${${(Az)LBUFFER}[-1]}
13    if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$word] -eq 0 ]]; then
14       zle _expand_alias
15       zle expand-word