Improve _get_comp_words_by_ref()
Empty $cur when cmd = "|a " (| = cursor position)
This commit is contained in:
parent
fc96a951b7
commit
2f37a38b79
@ -348,9 +348,10 @@ __get_cword_at_cursor_by_ref()
|
||||
local cword words=()
|
||||
__reassemble_comp_words_by_ref "$1" words cword
|
||||
|
||||
local i cur2
|
||||
local cur="$COMP_LINE"
|
||||
local index="$COMP_POINT"
|
||||
local i cur cur2
|
||||
local index=$COMP_POINT
|
||||
if (( index )); then
|
||||
cur=$COMP_LINE
|
||||
for (( i = 0; i <= cword; ++i )); do
|
||||
while [[
|
||||
# Current word fits in $cur?
|
||||
@ -373,6 +374,7 @@ __get_cword_at_cursor_by_ref()
|
||||
index=$(( index - old_size + new_size ))
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $index -lt 0 ]]; then
|
||||
# This happens when completing: "command | arg" (| is where
|
||||
|
Loading…
x
Reference in New Issue
Block a user