Thanks Luc. I haven't completely understood it yet, but I'll try it out.
On Mon, Aug 1, 2011 at 6:27 AM, <hermitte@...>
I forgot something regarding your need to know the exact choice even if there are ambiguities.
At this point, the string inserted is by no mean the final string, but something like a temporary identifier that I use to know which was the user's choice.
> "Amit Dev" wrote:
> > One thing I'm trying to do is to
> > use the custom completion function (^X^U). [...]
> > Is there a callback or something that can be registered to find out
> > which item user chose?
> In mu-template , I've proceeded the following (asynchronous) way.
> (I've found no way to proceed synchronously) :
> - use feedkey (in s:ChooseTemplateFile(), l.680) to call a function
> that returns nothing, but that calls complete()
> - the function called (s:ChooseByComplete(), l.643) prepares the
> dictionary for complete(), registers a hook (to be called at the end
> of the process), and calls complete() -- this is all done through a
> "library" that I wrote for the occasion (lh-vim-lib ->
> - the hook function (s:FinishCompletion(), l.659) extracts from the
> buffer what has really been inserted, and then do what I wished to
> do (here insert and interpret a template-file)
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