diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2008-09-29 17:40:54 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2008-09-29 17:40:54 +0000 |
| commit | 773800e0de3598707dca49eb8206d6e38ca654aa (patch) | |
| tree | 59434f93d36ed6cb163a4325b8826de114a90460 /Completion/Zsh/Context/_subscript | |
| parent | 25772: crash with bad associative array pattern search (diff) | |
| download | zsh-773800e0de3598707dca49eb8206d6e38ca654aa.tar zsh-773800e0de3598707dca49eb8206d6e38ca654aa.tar.gz zsh-773800e0de3598707dca49eb8206d6e38ca654aa.tar.bz2 zsh-773800e0de3598707dca49eb8206d6e38ca654aa.tar.lz zsh-773800e0de3598707dca49eb8206d6e38ca654aa.tar.xz zsh-773800e0de3598707dca49eb8206d6e38ca654aa.tar.zst zsh-773800e0de3598707dca49eb8206d6e38ca654aa.zip | |
25733: stub function for dynamic directory name completion
Diffstat (limited to 'Completion/Zsh/Context/_subscript')
| -rw-r--r-- | Completion/Zsh/Context/_subscript | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript index 0b23c1cac..cef0a46e5 100644 --- a/Completion/Zsh/Context/_subscript +++ b/Completion/Zsh/Context/_subscript @@ -10,7 +10,16 @@ fi compset -P '\(([^\(\)]|\(*\))##\)' # remove subscript flags -if [[ "$PREFIX" = :* ]]; then +# Look for a dynamic name expansion. Completion only gives us +# the stuff inside the square brackets; we need to find out what's +# outside. We ought to check for quoting, really, but given we've +# got to the subscript code " ~[" is pretty likely to be a dynamic +# name expansion. +integer pos=$((CURSOR+1)) +while [[ pos > 1 && $BUFFER[pos-1] != '[' ]]; do (( pos-- )); done +if [[ $BUFFER[1,pos] = *[[:space:]]##\~\[ ]]; then + _dynamic_directory_name +elif [[ "$PREFIX" = :* ]]; then _wanted characters expl 'character class' \ compadd -p: -S ':]' alnum alpha ascii blank cntrl digit graph \ lower print punct space upper xdigit |
