Fix extension completion

When inserting $extensionName in $COMP_WORDS manually, $COMP_CWORD lags
behind by one. Needs a manual adjustment too.
This commit is contained in:
Vladimir Zhelezov 2020-12-10 17:17:58 +01:00
parent 4101fdf3bb
commit c2da8ac2d4
2 changed files with 2 additions and 0 deletions

View File

@ -97,6 +97,7 @@ _hledger_extension_completion_function() {
# normal hledger completion function.
local extensionName=${cmd#*-}
COMP_WORDS=( "hledger" "$extensionName" "${COMP_WORDS[@]:1}" )
COMP_CWORD=$((COMP_CWORD + 1))
_hledger_completion_function "hledger" "$@"
}

View File

@ -97,6 +97,7 @@ _hledger_extension_completion_function() {
# normal hledger completion function.
local extensionName=${cmd#*-}
COMP_WORDS=( "hledger" "$extensionName" "${COMP_WORDS[@]:1}" )
COMP_CWORD=$((COMP_CWORD + 1))
_hledger_completion_function "hledger" "$@"
}