Skip to content

Commit

Permalink
Lazy completion loading for Zsh
Browse files Browse the repository at this point in the history
Fixes #473
  • Loading branch information
segevfiner committed Feb 26, 2024
1 parent 521082e commit dd75cc3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions argcomplete/shell_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from shlex import quote

bashcode = r"""
bashcode = r"""#compdef %(executables)s
# Run something, muting output or redirecting it to the debug stream
# depending on the value of _ARC_DEBUG.
# If ARGCOMPLETE_USE_TEMPFILES is set, use tempfiles for IPC.
Expand Down Expand Up @@ -76,7 +76,11 @@
complete %(complete_opts)s -F _python_argcomplete%(function_suffix)s %(executables)s
else
autoload is-at-least
compdef _python_argcomplete%(function_suffix)s %(executables)s
if [[ $zsh_eval_context == *func ]]; then
_python_argcomplete%(function_suffix)s "$@"
else
compdef _python_argcomplete%(function_suffix)s %(executables)s
fi
fi
"""

Expand Down

0 comments on commit dd75cc3

Please sign in to comment.