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

bug: _files depends on extendedglob



Here's a transcript from a session after I finally pieced together
what was breaking in
https://github.com/benknoble/Dotfiles/commit/9c7dd6d1ec8b3caac670f1a2a030769a4c90c06c,
which contains in its message more details about how I debugged this
particular failure.

zsh --version
zsh 5.9 (x86_64-apple-darwin20.6.0)
# macOS 12.7.2
zsh -f
temp=$(mktemp -d)
fpath+=($temp)
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh
-o $temp/_git
autoload -Uz compinit && compinit
_git_doc () { emulate -L zsh
  _files -W $(git --html-path)/
}
git doc <TAB>
# (eval):1: no matches found: *:globbed-files
# completion results still produced
_git_doc () { emulate -L zsh
  setopt extendedglob
  _files -W $(git --html-path)/
}
git doc <TAB>
# works like a charm

I'm not sure what the appropriate fix is, though I think some
combination of localopts and extendedglob might work? I see that some
parts of _files test for extendedglob, but the part that sets pats
that leads to the failure (line 78 for me) seems to be affected
without any test.

-- 
D. Ben Knoble




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