-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from Freed-Wu/master
Improve zsh completion
- Loading branch information
Showing
2 changed files
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,8 +50,8 @@ Website: <https://tug.org/texdoc/> | |
Repository: <https://github.com/TeX-Live/texdoc> | ||
Please email bugs to <[email protected]>.]] | ||
|
||
zsh_completion = [[ | ||
compdef __texdoc texdoc | ||
zsh_completion = [=[ | ||
#compdef texdoc | ||
__texdoc() { | ||
local options=( | ||
|
@@ -72,7 +72,15 @@ __texdoc() { | |
;; | ||
esac | ||
} | ||
]] | ||
if [[ $zsh_eval_context[-1] == loadautofunc ]]; then | ||
# autoload from fpath, call function directly | ||
__texdoc "$@" | ||
else | ||
# eval/source/. command, register function for later | ||
compdef __texdoc texdoc | ||
fi | ||
]=] | ||
|
||
--[[ structure of the options table | ||
|