1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-15 23:08:16 +08:00

Compare commits

..

No commits in common. "d05544562532fdf4d5f4a4d4eba01f4263e17cc7" and "fcb6fa78a1304f9a8eff2a7563658de04a13d499" have entirely different histories.

3 changed files with 23 additions and 29 deletions

View File

@ -6,8 +6,7 @@ function omz_history {
if [[ -n "$clear" ]]; then
# if -c provided, clobber the history file
echo -n >| "$HISTFILE"
fc -p "$HISTFILE"
echo >&2 History file deleted.
echo >&2 History file deleted. Reload the session to see its effects.
elif [[ -n "$list" ]]; then
# if -l provided, run as if calling `fc' directly
builtin fc "$@"

View File

@ -27,26 +27,19 @@ zstyle -T ':completion:*:*:git:*' tag-order && \
zstyle -s ":completion:*:*:git:*" script script
if [ -z "$script" ]; then
local -a locations
local e bash_completion
bash_completion=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null) ||
bash_completion='/usr/share/bash-completion/completions/'
local e
locations=(
"$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
"$HOME/.local/share/bash-completion/completions/git"
"$bash_completion/git"
"$(pkg-config --variable=completionsdir bash-completion)"/git
'/usr/share/bash-completion/completions/git'
'/etc/bash_completion.d/git' # old debian
)
for e in $locations; do
test -f $e && script="$e" && break
done
fi
local old_complete="$functions[complete]"
functions[complete]=:
GIT_SOURCING_ZSH_COMPLETION=y . "$script"
functions[complete]="$old_complete"
__gitcomp ()
{
@ -112,6 +105,21 @@ __gitcomp_nl ()
compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0
}
__gitcomp_nl_append ()
{
emulate -L zsh
compset -P '*[=:]'
compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0
}
__gitcomp_file_direct ()
{
emulate -L zsh
compadd -f -- ${(f)1} && _ret=0
}
__gitcomp_file ()
{
emulate -L zsh
@ -119,21 +127,6 @@ __gitcomp_file ()
compadd -f -p "${2-}" -- ${(f)1} && _ret=0
}
__gitcomp_direct_append ()
{
__gitcomp_direct "$@"
}
__gitcomp_nl_append ()
{
__gitcomp_nl "$@"
}
__gitcomp_file_direct ()
{
__gitcomp_file "$1" ""
}
_git_zsh ()
{
__gitcomp "v1.0"

View File

@ -3585,6 +3585,7 @@ __git_func_wrap ()
# This is NOT a public function; use at your own risk.
__git_complete ()
{
test -n "$ZSH_VERSION" && return
local wrapper="__git_wrap${2}"
eval "$wrapper () { __git_func_wrap $2 ; }"
complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \
@ -3606,7 +3607,8 @@ if ! git --list-cmds=main >/dev/null 2>&1; then
{
case "$1" in
--list-cmds=*)
while read -r -d ',' x; do
IFS=, read -r -a cmds <<< "${1##--list-cmds=}"
for x in ${cmds[@]}; do
case "$x" in
nohelpers)
;;
@ -3618,7 +3620,7 @@ if ! git --list-cmds=main >/dev/null 2>&1; then
echo ${__git_cmds[$x]}
;;
esac
done <<< "${1##--list-cmds=},"
done
return
;;
esac