Dasn wrote:

> On 04/01/08 18:27 +0100, Bram Moolenaar wrote:
> >!      * STYLE_VIMGLOB:      NL separated
> >!      *         If we use *sh*, we define "vimglob()".
> 
> I have been worried about the matched name which contains NL.

File names with an embedded NL are not supported.  They are uncommon and
generally frowned upon.

> $ cat test.vim
> call writefile([], "{foo")
> call writefile([], "{foo\nfoo")
> 
> $ vim -c "so test.vim"
> ~
> ~
> :set wildmenu
> :set shell=sh
> :e \{<Hit Tab>
> :" wildmenu returns ["test.vim" , "{foo", "{foo"], note the duplicate "{foo"s.
> :e <Hit Tab>
> :" wildmenu returns ["test.vim" , "{foo", "{foo<00>foo"], looks right,
> :" but it will cause an error when we choose "{foo<00>foo" to edit.
> :set shell=csh
> :e \{<Hit Tab>
> :" nothing got matched.

An alternative would be to try using NUL characters to separate the
items.  Unfortunately I could not find a way to make this work for the
sh of FreeBSD that I'm using.  The builtin echo command accepts -n and
-e, but not at the same time.  That's weird, but that's how it is.  So
you could use -e to add a NUL character, but you also get a NL then.

> IMHO, interacting with different shells is a complicated task. What
> about defining a Vim's own interface to the file system? Then if
> something should be expanded, such as environment variables, '~', etc,
> it can be direct processed in Vim via system interface (like getenv(3)),
> other than carefully interacting with various shells.

Vim already expands most things without using a shell.  The shell is
invoked only for expanding things that only the shell knows about.

-- 
The question is:  What do you do with your life?
The wrong answer is: Become the richest guy in the graveyard.
                                (billionaire and Oracle founder Larry Ellison)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui