Friday, October 7, 2016

:command -complete=custom with a glob()

I've been having an issue with a command completion function, particularly
with how it wraps around the ends of the matches. Normally after the last
match, the original text should be used before looping to the first match.
But when the function calls glob(), it no longer returns to the original
pattern, and instead loops immediately to the other end of the matches.

Am I just being stupid and doing something wrong?

Reduced case:

command! -nargs=1 -complete=custom,Test Test echo <q-args>

function! Test(ArgLead, CmdLine, CursorPos)
call glob('')
return "foo\nbar"
endfunction

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment