On 27/04/09 08:02 +0200, Christian Brabandt wrote:
> Hi Dasn!
>
> On Mo, 27 Apr 2009, Dasn wrote:
>
> > fun! MyFileComplete(ArgLead, CmdLine, CursorPos)
> > let ret=["file1", "file2", "file3"]
> > ".... A lot more other processing
> > return ret
> > endfun
> >
> > let cmd = input("Talking to Shell> ", "", "customlist,MyFileComplete")
> >
> > Then at the prompt, I type:
> > Talking to Shell> cp <Tab> "Hit tab wanna got a file completion
> >
> > The problem is: When I hit <Tab>, the "cp " (i.e, the command part) was
> > also unexpectedly replaced by 'file1', 'file2' or 'file3'. It seems that
> > the completion does not occur at the cursor position. Am I in the right
> > way to complete this, or any idea to make a completion at the current
> > cursor position?
>
> I think you are looking for complete-functions, rather than
> command-completion.
>
> So please read :h complete-functions.
>
Hi Christian, thanks for your reply.
I think the complete-functions are for insert-mode completions, while
the input() function works in cmdline. The cursor position I referred is
the cursor when we typing at the prompt of the input() function, not in
the window, I didn't make it clearly, sorry.
--
Dasn
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---