Skip to content

Commit

Permalink
PR Feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcrockett committed Dec 13, 2024
1 parent 5d2c107 commit 47e49f1
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions lib/git/aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,20 @@ _alias "$git_alias" "git"
# which I've altered slightly to be more flexible.
# https://github.com/bronson/dotfiles/blob/731bfd951be68f395247982ba1fb745fbed2455c/.bashrc#L81
# (only works for bash)
if [ "$git_skip_shell_completion" != "yes" ]; then
__define_git_completion () {
eval "
_git_$1_shortcut () {
COMP_LINE=\"git $2 \${COMP_LINE/$1 }\"
let COMP_POINT+=$((4+${#2}-${#1}))
COMP_WORDS=(git $2 \"\${COMP_WORDS[@]:1}\")
let COMP_CWORD+=1
local cur words cword prev
_get_comp_words_by_ref -n =: cur words cword prev
__git_wrap__git_main
}
"
}
fi
__define_git_completion () {
eval "
_git_$1_shortcut () {
COMP_LINE=\"git $2 \${COMP_LINE/$1 }\"
let COMP_POINT+=$((4+${#2}-${#1}))
COMP_WORDS=(git $2 \"\${COMP_WORDS[@]:1}\")
let COMP_CWORD+=1
local cur words cword prev
_get_comp_words_by_ref -n =: cur words cword prev
__git_wrap__git_main
}
"
}

# Define git alias with tab completion
# Usage: __git_alias <alias> <command_prefix> <command>
Expand Down

0 comments on commit 47e49f1

Please sign in to comment.