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

Re: custom-command-completion and access to built-in completions

Expand Messages
  • Hari Krishna Dara
    On Wed, 24 Mar 2004 at 11:09am, Hari Krishna Dara wrote: [snip] ... I was trying to implement this solution with glob(), but I realized it is not worth doing.
    Message 1 of 4 , Mar 26, 2004
    • 0 Attachment
      On Wed, 24 Mar 2004 at 11:09am, Hari Krishna Dara wrote:

      [snip]

      >
      > >
      > > > Meanwhile, I am wondering if I can just use glob() function by appending
      > > > '*' over the partially typed in text (I will have to find the substring
      > > > from the previous unprotected space) to get the same result. My brief
      > > > experiments show that it can work, but I would appreciate if someone can
      > > > confirm.
      > >
      > > For file name completion glob() is the right thing.
      >
      > Thanks for confirming this.
      >
      > Hari

      I was trying to implement this solution with glob(), but I realized it is
      not worth doing. I got it nicely figured out when to do glob(), but
      what I realized is that the default file completion does more than just
      glob(). It appends path separator automatically if it is a directory, it
      converts the pathseparator automatically based on the 'shellslash'
      setting (which would even be impossible with this approach) and may be
      more.

      Also, there seems to be some bugs in handling the completion options.
      When the partial string was 'src\A' my completion function returned
      glob('src\A*'), but Vim ignored all the return values for some reason.
      But when I tried to complete 'src\', I nicely got the completions for
      all files under src.

      Hari

      __________________________________
      Do you Yahoo!?
      Yahoo! Finance Tax Center - File online. File on time.
      http://taxes.yahoo.com/filing.html
    Your message has been successfully submitted and would be delivered to recipients shortly.