On Mon, 26 Jul 2010, Bram Moolenaar wrote:

Christian J. Robinson wrote:

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.

But that doesn't work either. I can use the full command line to figure out the whole completion and return the possible completions, but Vim still inserts the new whole completion (with spaces) only in place of the text after the last space--it does not replace the entire text it should be replacing.

Can I somehow tell Vim to replace the entire set of arguments after the command itself during completion?

I really do think Vim should treat backslash-escaped spaces as being part of a greater single argument. As far as I can tell, as it is I have no way of effectively dealing with spaces in arguments during custom completion.

Perhaps Vim could be altered to do it more like what I want if a command is defined with -nargs=? or -nargs=1 instead of -nargs=*?

- Christian

--
Christian J. Robinson <[email protected]> -- http://christianrobinson.name/

--
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