diff --git a/completion/available/complete-typo.completion.bash b/completion/available/complete-typo.completion.bash index f7099cb763..35307b522f 100644 --- a/completion/available/complete-typo.completion.bash +++ b/completion/available/complete-typo.completion.bash @@ -18,14 +18,17 @@ function _use_complete_typo { _log_error "Please enable the typos plugin to use this completion" return 1 fi - complete -F _complete_typo "${!_BASH_IT_TYPOS[@]}" + complete -F _complete_alias_for_typos "${!_BASH_IT_TYPOS[@]}" } -function _complete_typo { - ( - _typos-load - _complete_alias - ) + +# Named to be compatible with _complete_alias checking https://github.com/cykerway/complete-alias/blob/7f2555c2fe7a1f248ed2d4301e46c8eebcbbc4e2/complete_alias#L806 +function _complete_alias_for_typos { + _typos-load + _complete_alias + local ret=$? + _typos-unload + return $ret } diff --git a/plugins/available/jake-typos.plugin.bash b/plugins/available/jake-typos.plugin.bash index 9cab96362b..26d18ed1d3 100644 --- a/plugins/available/jake-typos.plugin.bash +++ b/plugins/available/jake-typos.plugin.bash @@ -85,6 +85,10 @@ function _typos-load { done } +function _typos-unload { + unalias "${!_BASH_IT_TYPOS[@]}" +} + function typos { ( unalias -a