This commit is contained in:
Shelvacu
2025-05-05 21:43:21 -07:00
committed by Shelvacu on fw
parent 8159232e8c
commit e7a8586aea

View File

@@ -34,9 +34,9 @@ let
local replacementWords=(${lib.escapeShellArgs args})
local replacementStr="''${replacementWords[*]}"
COMP_LINE="''${COMP_LINE/#$aliasName/$replacementStr}"
COMP_POINT=(( COMP_POINT + (#replacementStr - #aliasName) ))
COMP_CWORD=(( COMP_CWORD + (#replacementWords - 1) ))
COMP_WORDS=("''${replacementWords[@]}" "''${COMP_WORDS:1}")
COMP_POINT=$(( COMP_POINT + ''${#replacementStr} - ''${#aliasName} ))
COMP_CWORD=$(( COMP_CWORD + ''${#replacementWords[@]} - 1 ))
COMP_WORDS=("''${replacementWords[@]}" "''${COMP_WORDS[@]:1}")
_comp_command_offset 0
'';
in