__get_cword_at_cursor_by_ref: Drop unnecessary quotes.

This commit is contained in:
Igor Murzov 2011-11-17 00:11:46 +03:00
parent b3fcb55dcf
commit 068a1a1b53

View File

@ -310,7 +310,7 @@ __get_cword_at_cursor_by_ref()
for (( i = 0; i <= cword; ++i )); do
while [[
# Current word fits in $cur?
"${#cur}" -ge ${#words[i]} &&
${#cur} -ge ${#words[i]} &&
# $cur doesn't match cword?
"${cur:0:${#words[i]}}" != "${words[i]}"
]]; do
@ -321,11 +321,11 @@ __get_cword_at_cursor_by_ref()
done
# Does found word match cword?
if [[ "$i" -lt "$cword" ]]; then
if [[ $i -lt $cword ]]; then
# No, cword lies further;
local old_size="${#cur}"
local old_size=${#cur}
cur="${cur#"${words[i]}"}"
local new_size="${#cur}"
local new_size=${#cur}
index=$(( index - old_size + new_size ))
fi
done