Re: Bug in Vim brace expansion

2007-11-13 Fir de Conversatie Dasn
On 12/11/07 22:45 +0100, Nikolai Weibull wrote: On Nov 12, 2007 10:34 PM, Bram Moolenaar [EMAIL PROTECTED] wrote: Nikolai Weibull wrote: Another issue is that there's doesn't seem to be a way to escape a comma inside a brace expansion. Neither two commas in a row or a backslash seem to

Re: Bug in Vim brace expansion

2007-11-13 Fir de Conversatie Dasn
On 13/11/07 17:25 +0800, Dasn wrote: On 12/11/07 22:45 +0100, Nikolai Weibull wrote: On Nov 12, 2007 10:34 PM, Bram Moolenaar [EMAIL PROTECTED] wrote: Nikolai Weibull wrote: Another issue is that there's doesn't seem to be a way to escape a comma inside a brace expansion. Neither two

Re: Bug in Vim brace expansion

2007-11-13 Fir de Conversatie Vladimir Marek
[...] Vim treats backtick-ed string honestly, so you can match some kinda weird looking patterns via shell directly. e.g: :echo glob('`for i in ~/{bin,tmp,\,}; do echo $i; done`') A note, this might be incorrect if the name got matched contains special chars like '\n'. Would there be a

Re: Bug in Vim brace expansion

2007-11-13 Fir de Conversatie Dasn
On 13/11/07 16:59 +0100, Vladimir Marek wrote: Would there be a way to read in string containing \000 character ? That way you could use ...; do printf $i\000; done However that does not seem to be possible: :echo system(printf 'aaa\000bbb') E484: Can't open file /tmp/v984274/8 :echo

Re: Bug in Vim brace expansion

2007-11-13 Fir de Conversatie Vladimir Marek
Would there be a way to read in string containing \000 character ? That way you could use ...; do printf $i\000; done However that does not seem to be possible: :echo system(printf 'aaa\000bbb') E484: Can't open file /tmp/v984274/8 :echo system(sh -c ' . 'printf aaa\000bbb' . ')

Bug in Vim brace expansion

2007-11-12 Fir de Conversatie Nikolai Weibull
echo glob('~/{,}') /home/user// /home/user// The bug is that an extra slash is added at the end. It's only a minory issue, as slashes are usually folded by the OS anyway, but it would be better if they weren't added. Another issue is that there's doesn't seem to be a way to escape a comma

Re: Bug in Vim brace expansion

2007-11-12 Fir de Conversatie Vladimir Marek
Hi, Another issue is that there's doesn't seem to be a way to escape a comma inside a brace expansion. Neither two commas in a row or a backslash seem to generate a comma. glob behaves depending on your shell settings. Out of my experience, best is csh or tcsh, where glob works reliably.

Re: Bug in Vim brace expansion

2007-11-12 Fir de Conversatie Nikolai Weibull
On Nov 12, 2007 3:09 PM, Vladimir Marek [EMAIL PROTECTED] wrote: Another issue is that there's doesn't seem to be a way to escape a comma inside a brace expansion. Neither two commas in a row or a backslash seem to generate a comma. glob behaves depending on your shell settings. Out of

Re: Bug in Vim brace expansion

2007-11-12 Fir de Conversatie Nikolai Weibull
On Nov 12, 2007 3:36 PM, Vladimir Marek [EMAIL PROTECTED] wrote: Another issue is that there's doesn't seem to be a way to escape a comma inside a brace expansion. Neither two commas in a row or a backslash seem to generate a comma. glob behaves depending on your shell settings.

Re: Bug in Vim brace expansion

2007-11-12 Fir de Conversatie Nikolai Weibull
On Nov 12, 2007 3:40 PM, Matt Wozniski [EMAIL PROTECTED] wrote: On Nov 12, 2007 9:16 AM, Nikolai Weibull [EMAIL PROTECTED] wrote: On Nov 12, 2007 3:09 PM, Vladimir Marek [EMAIL PROTECTED] wrote: Another issue is that there's doesn't seem to be a way to escape a comma inside a

Re: Bug in Vim brace expansion

2007-11-12 Fir de Conversatie Matt Wozniski
On Nov 12, 2007 9:42 AM, Nikolai Weibull [EMAIL PROTECTED] wrote: Either way, there's no way to escape a comma inside braces. :echo glob('/tmp/{a,b\\054c}') That works for shell=/bin/zsh and shell=/bin/tcsh for me, though not for shell=/bin/bash. While I agree that you ought to be able to

Re: Bug in Vim brace expansion

2007-11-12 Fir de Conversatie Vladimir Marek
:set shell=/bin/tcsh :echo glob(a 'b/*) - a 'b/file :set shell=/bin/bash :echo glob(a 'b/*) - a [...] Uh. That's horrible. It's a pain that whenever you do any kind of VimScripting you always have to cover all your bases. It's getting to become unmanageable. Personally I would

Re: Bug in Vim brace expansion

2007-11-12 Fir de Conversatie Matt Wozniski
On Nov 12, 2007 9:56 AM, Vladimir Marek [EMAIL PROTECTED] wrote: Personally I would like to see something like glob_internal() which would do globbing entirely in c without accessing your shell. But I'm not going to write the patch, so I just silently hope :) Or having readdir to be able to

Re: Bug in Vim brace expansion

2007-11-12 Fir de Conversatie Bram Moolenaar
Nikolai Weibull wrote: echo glob('~/{,}') /home/user// /home/user// The bug is that an extra slash is added at the end. It's only a minory issue, as slashes are usually folded by the OS anyway, but it would be better if they weren't added. Yes, it's strange that the extra {} results