Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: GLOB_COMPLETE and numbered directories



On Thu, Mar 19, 2015 at 8:32 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Consider the following:
>
> % zsh -f
> % autoload compinit && compinit
> % setopt globcomplete
> % find
> .
> % mkdir -p {bar,baz}/iota
> % cat b/i<TAB>
> [cycles between 'cat ba<CURSOR>/iota', 'cat bar/iota/', 'cat baz/iota/']
>
> The above works as expected.  However, if the directory names are
> different, completion behaves differently:
>
> % rm -rf bar baz
> % mkdir -p {10a,11a}/iota
> % cat 1/i<CURSOR>
> [press <TAB>]
> % cat 1<CURSOR>a/iota
> [press <TAB>]
> % cat 1a/iota<CURSOR>
> [stays the same upon pressing TAB]
>
> I expected the second <TAB> press to offer me the possible completions
> '10a' '11a'.  I'd at least like not to be left with "1a/iota<CURSOR>"
> since "1a" is not a possible completion or an existent directory, and
> with the cursor far from the "1a" fixing the erroneous path requires too
> much effort ;).

Are you sure the difference isn't because your differing character is
now not the last character of the directory name?

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author