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

Re: completion in quotes - " vs ' - no suffix added



Bart Schaefer wrote:

> ...
> 
> Hmm.  It's slightly worse than that ...
> 
> schaefer<510> functions _foo
> _foo () {
>         local suf="/ \t\n"
>         [[ -n $compstate[quote] ]] && { suf="$compstate[quote]$suf" 
>                 compset -q }
>         _files -r $suf
> }
> schaefer<511> compdef _foo foo         
> schaefer<512> ls                 
> don't stop/  rmthat/
> schaefer<514> foo '<TAB>
> Completing file
> don\'\''t\ stop   rmthat/         
> schaefer<514> foo "<TAB>
> Completing file
> don\\'t\\ stop   rmthat/        
> 
> Wrong number of backslashes in both cases; that's why the trailing suffix
> didn't get added.  This looks similar to the problem we had with _values,
> that Sven patched in 16998.

No, it doesn't: there's nothing wrong, as far as I can see. Always
remember, what `compset -q' is intended for, namely things like:

  zsh -c 'echo do<TAB>

Try it and you'll see that it does the right thing. At least it does
for me.

What Andrej probably wants is splitting the current string with a
combination of `compset -[PS]' and the ${(z)...} parameter flag. I'd
like to know how that command is then able to find the different
sub-words in the quoted string if things like spaces are not quoted a
second time.

Or am I missing something?


Bye
  Sven

-- 
Sven Wischnowsky                          wischnow@xxxxxxxxx



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