Bug#622383: bash-completion: completion only works from left to right: error : bash: $index: substring expression < 0

2011-04-12 Thread Alban Browaeys
Le mardi 12 avril 2011 à 22:15 +0200, David Paleino a écrit :
> tags 622383 fixed-upstream
> thanks
> 
> Hello Alban,
> 
> On Tue, 12 Apr 2011 19:43:02 +0200, Alban Browaeys wrote:
> 
> > [..]
> > bash: $index: substring expression < 0
> 
> I think I fixed it.
> 
>   
> http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=4ad538ba1a0ccb483899b4eaa70cc604d2b7bf78
> 

Indeed it is gone ! (I am using the full bash-completion set from git)
No more in need to clean the command  line to complete a forgotten token
in the middle.

Congratulations
Alban




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#622383: bash-completion: completion only works from left to right: error : bash: $index: substring expression < 0

2011-04-12 Thread David Paleino
tags 622383 fixed-upstream
thanks

Hello Alban,

On Tue, 12 Apr 2011 19:43:02 +0200, Alban Browaeys wrote:

> [..]
> bash: $index: substring expression < 0

I think I fixed it.

  
http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=4ad538ba1a0ccb483899b4eaa70cc604d2b7bf78

Please wait for the next Debian package, or apply the patch yourself :)

Kindly,
David

-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 | http://deb.li/dapal
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174


signature.asc
Description: PGP signature


Bug#622383: bash-completion: completion only works from left to right: error : bash: $index: substring expression < 0

2011-04-12 Thread David Paleino
tags 622383 = confirmed upstream
thanks

On Tue, 12 Apr 2011 19:43:02 +0200, Alban Browaeys wrote:

> Le mardi 12 avril 2011 à 19:16 +0200, David Paleino a écrit :
> > I can't reproduce this (| is where I place the cursor, and hit TAB):
> > 
> > $ ls a|
> > acpi-path-to-use-sysfs.mdwn  am-assigned.mdwn
> > [..]
> > $ ls |a
> > Display all 110 possibilities? (y or n)
> > ^C
> > $
> 
> Sorry I forgot to tell there need to be a space before and after the
> location where the cursor is:
> $ ls   a

Ok, confirming it now, it also happens with the latest git revision.

> $ ls + local cur prev split=false
> + _get_comp_words_by_ref -n = cur prev
> + local exclude flag i OPTIND=1
> + words=()
> + local cur cword words
> + upargs=()
> + upvars=()
> + local upargs upvars vcur vcword vprev vwords
> + getopts c:i:n:p:w: flag -n = cur prev
> + case $flag in
> + exclude==
> + getopts c:i:n:p:w: flag -n = cur prev
> + [[ 4 -ge 3 ]]
> + case ${!OPTIND} in
> + vcur=cur
> + let 'OPTIND += 1'
> + [[ 4 -ge 4 ]]
> + case ${!OPTIND} in
> + vprev=prev
> + let 'OPTIND += 1'
> + [[ 4 -ge 5 ]]
> + __get_cword_at_cursor_by_ref = words cword cur
> + words=()
> + local cword words
> + __reassemble_comp_words_by_ref = words cword
> + local exclude i j ref
> + [[ -n = ]]
> + exclude==
> + eval cword=1
> ++ cword=1
> + [[ -n = ]]
> + (( i=0, j=0 ))
> + (( i < 2 ))
> + [[ 0 -gt 0 ]]
> + ref='words[0]'
> + eval 'words[0]=${!ref}${COMP_WORDS[i]}'
> ++ words[0]=ls
> + [[ 0 == 1 ]]
> + (( i++, j++ ))
> + (( i < 2 ))
> + [[ 1 -gt 0 ]]
> + [[ -n a ]]
> + [[ '' == a ]]
> + ref='words[1]'
> + eval 'words[1]=${!ref}${COMP_WORDS[i]}'
> ++ words[1]=a
> + [[ 1 == 1 ]]
> + eval cword=1
> ++ cword=1
> + (( i++, j++ ))
> + (( i < 2 ))
> + local i cur2
> + local 'cur=ls  a'
> + local index=3
> + (( i = 0 ))
> + (( i <= cword ))
> + [[ 5 -ge 2 ]]
> + [[ ls != \l\s ]]
> + [[ 0 -lt 1 ]]
> + local old_size=5
> + cur='  a'
> + local new_size=3
> + index=1
> + (( ++i  ))
> + (( i <= cword ))
> + [[ 3 -ge 1 ]]
> + [[   != \a ]]
> + cur=' a'
> + (( index-- ))
> + [[ 2 -ge 1 ]]
> + [[   != \a ]]
> + cur=a
> + (( index-- ))
> + [[ 1 -ge 1 ]]
> + [[ a != \a ]]
> + [[ 1 -lt 1 ]]
> + (( ++i  ))
> + (( i <= cword ))
> + [[ a != \a ]]
> bash: $index: substring expression < 0

I'll investigate this, thanks.

Kindly,
David

-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 | http://deb.li/dapal
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174


signature.asc
Description: PGP signature


Bug#622383: [Bash-completion-devel] Bug#622383: bash-completion: completion only works from left to right: error : bash: $index: substring expression < 0

2011-04-12 Thread Alban Browaeys
Le mardi 12 avril 2011 à 19:16 +0200, David Paleino a écrit :
> tags 622383 unreproducible moreinfo
> thanks
> 
> Hello,
> 
> On Tue, 12 Apr 2011 18:56:58 +0200, Alban Browaeys wrote:
> 
> > Typing :
> > $ ls a
> > then moving the cursor between 'ls' and 'a' and pressing  leads to:
> > bash: $index: substring expression < 0
> > 
> > Thus completion only works right to the last character in a command. Is a 
> > fix
> > at reach ? Or is it by design ?
> 
> I can't reproduce this (| is where I place the cursor, and hit TAB):
> 
> $ ls a|
> acpi-path-to-use-sysfs.mdwn  am-assigned.mdwn
> [..]
> $ ls |a
> Display all 110 possibilities? (y or n)
> ^C
> $
> 

Sorry I forgot to tell there need to be a space before and after the
location where the cursor is:
$ ls   a


> Can you please "set -x", and paste/attach the output to the bugreport?
> 
> Thank you,
> David
> 

$ ls + local cur prev split=false
+ _get_comp_words_by_ref -n = cur prev
+ local exclude flag i OPTIND=1
+ words=()
+ local cur cword words
+ upargs=()
+ upvars=()
+ local upargs upvars vcur vcword vprev vwords
+ getopts c:i:n:p:w: flag -n = cur prev
+ case $flag in
+ exclude==
+ getopts c:i:n:p:w: flag -n = cur prev
+ [[ 4 -ge 3 ]]
+ case ${!OPTIND} in
+ vcur=cur
+ let 'OPTIND += 1'
+ [[ 4 -ge 4 ]]
+ case ${!OPTIND} in
+ vprev=prev
+ let 'OPTIND += 1'
+ [[ 4 -ge 5 ]]
+ __get_cword_at_cursor_by_ref = words cword cur
+ words=()
+ local cword words
+ __reassemble_comp_words_by_ref = words cword
+ local exclude i j ref
+ [[ -n = ]]
+ exclude==
+ eval cword=1
++ cword=1
+ [[ -n = ]]
+ (( i=0, j=0 ))
+ (( i < 2 ))
+ [[ 0 -gt 0 ]]
+ ref='words[0]'
+ eval 'words[0]=${!ref}${COMP_WORDS[i]}'
++ words[0]=ls
+ [[ 0 == 1 ]]
+ (( i++, j++ ))
+ (( i < 2 ))
+ [[ 1 -gt 0 ]]
+ [[ -n a ]]
+ [[ '' == a ]]
+ ref='words[1]'
+ eval 'words[1]=${!ref}${COMP_WORDS[i]}'
++ words[1]=a
+ [[ 1 == 1 ]]
+ eval cword=1
++ cword=1
+ (( i++, j++ ))
+ (( i < 2 ))
+ local i cur2
+ local 'cur=ls  a'
+ local index=3
+ (( i = 0 ))
+ (( i <= cword ))
+ [[ 5 -ge 2 ]]
+ [[ ls != \l\s ]]
+ [[ 0 -lt 1 ]]
+ local old_size=5
+ cur='  a'
+ local new_size=3
+ index=1
+ (( ++i  ))
+ (( i <= cword ))
+ [[ 3 -ge 1 ]]
+ [[   != \a ]]
+ cur=' a'
+ (( index-- ))
+ [[ 2 -ge 1 ]]
+ [[   != \a ]]
+ cur=a
+ (( index-- ))
+ [[ 1 -ge 1 ]]
+ [[ a != \a ]]
+ [[ 1 -lt 1 ]]
+ (( ++i  ))
+ (( i <= cword ))
+ [[ a != \a ]]
bash: $index: substring expression < 0

Best regards,
Alban





-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#622383: bash-completion: completion only works from left to right: error : bash: $index: substring expression < 0

2011-04-12 Thread Alban Browaeys
Package: bash-completion
Version: 1:1.3-2
Severity: wishlist

Typing :
$ ls a
then moving the cursor between 'ls' and 'a' and pressing  leads to:
bash: $index: substring expression < 0

Thus completion only works right to the last character in a command. Is a fix
at reach ? Or is it by design ?
I could spend some time on this issue though I have not looked into it since 
bash 3.0 so
I bet most of what I know is obsolete. A clue would be welcomed.

Best regards,
Alban

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages bash-completion depends on:
ii  bash  4.1-3  The GNU Bourne Again SHell

bash-completion recommends no packages.

bash-completion suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#622383: [Bash-completion-devel] Bug#622383: bash-completion: completion only works from left to right: error : bash: $index: substring expression < 0

2011-04-12 Thread David Paleino
tags 622383 unreproducible moreinfo
thanks

Hello,

On Tue, 12 Apr 2011 18:56:58 +0200, Alban Browaeys wrote:

> Typing :
> $ ls a
> then moving the cursor between 'ls' and 'a' and pressing  leads to:
> bash: $index: substring expression < 0
> 
> Thus completion only works right to the last character in a command. Is a fix
> at reach ? Or is it by design ?

I can't reproduce this (| is where I place the cursor, and hit TAB):

$ ls a|
acpi-path-to-use-sysfs.mdwn  am-assigned.mdwn
[..]
$ ls |a
Display all 110 possibilities? (y or n)
^C
$

Can you please "set -x", and paste/attach the output to the bugreport?

Thank you,
David

-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 | http://deb.li/dapal
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174


signature.asc
Description: PGP signature