Loading ...
Sorry, an error occurred while loading the content.

Re: Complete with Funcref?

Expand Messages
  • Tony Mechelynck
    ... Does it work if you use (untested) command! -nargs=1 -complete=custom,eval( TestFuncFuncref ) Testcmd or exe command! -nargs=1 -complete=custom, .
    Message 1 of 2 , Aug 24, 2007
    • 0 Attachment
      Andy Wokula wrote:
      > I'd like to have a Funcref provide completions, but
      > this seems not to be supported yet:
      >
      >
      > function! TestComplete(arglead, cmdline, curpos)
      > return "foo\nbar"
      > endfunction
      >
      > let TestFuncref = function("TestComplete")
      >
      > command! -nargs=1 -complete=custom,TestFuncref Testcmd
      >
      >
      > :Testcmd <Tab>
      > E117: Unknown function: TestFuncref
      >
      > :echo TestFuncref(1,2,3)
      > foo
      > bar
      >
      >
      > Am I missing something?
      >

      Does it work if you use (untested)

      command! -nargs=1 -complete=custom,eval("TestFuncFuncref") Testcmd

      or

      exe 'command! -nargs=1 -complete=custom,' . eval("TestFuncref") 'Testcmd'

      ?


      Best regards,
      Tony.
      --
      The defense attorney was hammering away at the plaintiff: "You
      claim," he jeered, "that my client came at you with a broken bottle in
      his hand. But is it not true, that you had something in YOUR hand?"

      "Yes," he admitted, "his wife. Very charming, of course, but
      not much good in a fight."

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.