Christian J. Robinson wrote:

> Perhaps I'm just not implementing my complete function properly, but 
> when I try to define a new :command that uses a function for 
> completion, I'm having it return a list with spaces in the list items 
> escaped with a backslash.
> 
> Nevertheless, when an argument with any escaped spaces is inserted 
> into the command line, any further completion attempt passes ONLY the 
> characters after the last space, even though it is escaped, to the 
> first argument of my complete function.
> 
> My explanation is probably unclear, but I can reproduce it by sourcing 
> the attached file, typing ":Foo " and pressing tab (clear away the 
> blank confirm dialog), then pressing backspace to delete the '1' and 
> then pressing tab again.  The confirm dialog shows only "bar" instead 
> of "foo\ bar"/"foo bar".  Clearing away that confirm dialog shows 
> "foo\ foo\ bar1" on the command line.

You also get the whole command line and the cursor position.  You can
use that to figure out the whole completion.  Vim doesn't know that the
thing being completed could continue before a space.

-- 
Why is "abbreviation" such a long word?

 /// Bram Moolenaar -- b...@moolenaar.net -- 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.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui