Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Make dynamic directory completion work in command position as well



This will still complete dynamic dirs when autocd isn't set, but since
the alternative is completing ~[parameters] I don't think it hurts much.

Ie, this is what it did before,
% ~[COLUMNS]
zsh: no directory expansion: ~[COLUMNS]

---
 Completion/Zsh/Context/_subscript |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript
index 31da97e..2e0743e 100644
--- a/Completion/Zsh/Context/_subscript
+++ b/Completion/Zsh/Context/_subscript
@@ -18,7 +18,7 @@ compset -P '\(([^\(\)]|\(*\))##\)' # remove subscript flags
 # or colon list.
 integer pos=$((CURSOR+1))
 while [[ pos -gt 1 && $BUFFER[pos-1] != '[' ]]; do (( pos-- )); done
-if [[ $BUFFER[1,pos-1] = *[[:space:]:=]##\~\[ ]]; then
+if [[ $BUFFER[1,pos-1] = ((#s)|*[[:space:]:=]##)\~\[ ]]; then
   _dynamic_directory_name
 elif [[ "$PREFIX" = :* ]]; then
   _wanted characters expl 'character class' \
-- 
1.7.4-rc1



Messages sorted by: Reverse Date, Date, Thread, Author