Skip to content

Commit

Permalink
fix: running autocomplete only when complete function is present
Browse files Browse the repository at this point in the history
  • Loading branch information
miki725 committed Feb 26, 2025
1 parent 24ad74c commit d005f1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/autocomplete/default.bash
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ function _chalk_shift_one {
}

function _chalk_completions {

_get_comp_words_by_ref cur prev words cword

_CHALK_CUR_IX=0
Expand All @@ -168,4 +167,6 @@ function _chalk_completions {
_chalk_toplevel_completions
}

complete -F _chalk_completions chalk
if type complete; then
complete -F _chalk_completions chalk
fi
5 changes: 3 additions & 2 deletions src/autocomplete/mac.bash
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,13 @@ function _chalk_shift_one {
}

function _chalk_completions {

_CHALK_CUR_IX=0
_CHALK_CUR_WORD=${2}
_CHALK_PREV=${3}

_chalk_toplevel_completions
}

complete -F _chalk_completions chalk
if type complete; then
complete -F _chalk_completions chalk
fi

0 comments on commit d005f1f

Please sign in to comment.