bec53135e4e826e204c3d11df9854a53403d11e3

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

Message

Fix shwordsplit bug when a basedir contains spaces

The `shwordsplit` option affects all variables and we only need to split
the `$EDITOR` variable. Because of that, using `${=spec}` is a much better
alternative.

More info at
http://zsh.sourceforge.net/Doc/Release/Expansion.html#index-SH_005fWORD_005fSPLIT_002c-toggle

Diff

 1diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh
 2index bb3d9c05807c6f3994527f0807964c3d6ab7db1a..84d0cfa65849fc07a5a668e270b4728b711c75bd 100644
 3--- a/plugins/pj/pj.plugin.zsh
 4+++ b/plugins/pj/pj.plugin.zsh
 5@@ -2,7 +2,6 @@ alias pjo="pj open"
 6 
 7 pj () {
 8     emulate -L zsh
 9-    setopt shwordsplit
10 
11     cmd="cd"
12     project=$1
13@@ -10,7 +9,7 @@ pj () {
14     if [[ "open" == "$project" ]]; then
15         shift
16         project=$*
17-        cmd=$EDITOR
18+        cmd=${=EDITOR}
19     else
20         project=$*
21     fi