Skip to content

Commit

Permalink
Merge pull request #296 from jamesd/preload-git-completions
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque authored Apr 13, 2021
2 parents 4cc623f + 4661cc9 commit 1dcfd26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ root = true
end_of_line = lf
insert_final_newline = true

[vcsh]
[{vcsh,_vcsh_bash}]
indent_style = tab
trim_trailing_whitespace = true
11 changes: 9 additions & 2 deletions _vcsh_bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ _vcsh_git_command () {
COMP_WORDS[0]=git
((COMP_CWORD -= word_offset - 1))

local cspec=$( complete -p git 2>/dev/null )
local cspec
cspec=$( complete -p git 2>/dev/null )
if [[ -z $cspec ]]; then
if declare -F __load_completion &> /dev/null; then
__load_completion git
cspec=$( complete -p git 2>/dev/null )
fi
fi
if [[ -n $cspec ]]; then
if [[ ${cspec#* -F } != $cspec ]]; then
local func=${cspec#*-F }
Expand Down Expand Up @@ -62,7 +69,7 @@ _vcsh () {
unset r reponames
local cmds
cmds="clone delete enter foreach help init list list-tracked list-untracked
pull push rename run status upgrade version which write-gitignore"
pull push rename run status upgrade version which write-gitignore"

local subcword cmd subcmd
for (( subcword=1; subcword < ${#words[@]}-1; subcword++ )); do
Expand Down

0 comments on commit 1dcfd26

Please sign in to comment.