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

Re: Patch 7.3.294

Expand Messages
  • MURAOKA Taro
    Hmm. It seems too tricky. How about this more formed idea. Vim can check type of returned value from completefunc, so vim should accept not only array but
    Message 1 of 9 , Sep 7, 2011
    • 0 Attachment
      Hmm. It seems too tricky. How about this more formed idea.

      Vim can check type of returned value from completefunc, so vim should
      accept not only array but also dictionary. For array value, vim use it
      as same as currently. For dictionary value, vim behaves some parsing on
      it.

      For example, 'refresh' means as you wrote, 'candidates' has array of
      completion candidates.

      let l = list-with-complete-items
      return { 'refresh': 'always', 'candidates': l }

      Besides it is extensible for future use.


      2011/9/7 Bram Moolenaar <Bram@...>:
      >
      > Taro Muraoka wrote:
      >
      >> > Perhaps the complete function should somehow indicate that it
      >> > must be called whenever the leader changes.
      >>
      >> I thought about that too.
      >>
      >> It would be better that second 'complefunc' option, like
      >> 'completefunc2'.  Of course 'completefunc2' prior to 'completefunc' when
      >> both of them are set.  Changing the specification of original
      >> 'completefunc' causes other problems, like patch#289.
      >>
      >> How do you think about this idea?  If you feed good, I will start to
      >> implement it.
      >
      > The return value of the function is a list.  We could add a special item
      > in the list to indicate the special behavior, but that's weird.
      >
      > Adding a couple of new options isn't nice either.  But the only
      > alternative I can think of right now is setting a variable, which isn't
      > nice either.
      >
      > The least worst solution seems to be to have the function return a first
      > element in the list that is a dictionary, and instead of containing a
      > "word" item it contains a "refresh" entry.  You could set it to "always"
      > to have the function called every time the leader changes.  That leaves
      > room for other behavior later.
      >
      > Thus, at the end of the function:
      >
      >        let l = list-with-complete-items
      >        call insert(l, {'refresh': 'always'})
      >        return l
      >
      > --
      > Team-building exercises come in many forms but they all trace their roots back
      > to the prison system.  In your typical team-building exercise the employees
      > are subjected to a variety of unpleasant situations until they become either a
      > cohesive team or a ring of car jackers.
      >                                (Scott Adams - The Dilbert principle)
      >
      >  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
      > ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      > \\\  an exciting new programming language -- http://www.Zimbu.org        ///
      >  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
      >



      --
      MURAOKA Taro <koron.kaoriya@...>

      --
      You received this message from the "vim_dev" 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
    • Bram Moolenaar
      ... Yes, that would work as well. Instead of candidates I would call it words . Mainly because it s simpler. -- For large projects, Team Leaders use
      Message 2 of 9 , Sep 7, 2011
      • 0 Attachment
        Taro Muraoka wrote:

        > Hmm. It seems too tricky. How about this more formed idea.
        >
        > Vim can check type of returned value from completefunc, so vim should
        > accept not only array but also dictionary. For array value, vim use it
        > as same as currently. For dictionary value, vim behaves some parsing on
        > it.
        >
        > For example, 'refresh' means as you wrote, 'candidates' has array of
        > completion candidates.
        >
        > let l = list-with-complete-items
        > return { 'refresh': 'always', 'candidates': l }
        >
        > Besides it is extensible for future use.

        Yes, that would work as well.

        Instead of "candidates" I would call it "words". Mainly because it's
        simpler.

        --
        For large projects, Team Leaders use sophisticated project management software
        to keep track of who's doing what. The software collects the lies and guesses
        of the project team and organizes them in to instantly outdated charts that
        are too boring to look at closely. This is called "planning".
        (Scott Adams - The Dilbert principle)

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        You received this message from the "vim_dev" 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
      • MURAOKA Taro
        I wrote new version as discussed. And I made some small changes on a document also. Please check it, and give any comments. Thanks. ... -- MURAOKA Taro
        Message 3 of 9 , Sep 11, 2011
        • 0 Attachment
          I wrote new version as discussed.
          And I made some small changes on a document also.
          Please check it, and give any comments.

          Thanks.


          2011/9/8 MURAOKA Taro <koron.kaoriya@...>:
          >> Instead of "candidates" I would call it "words".  Mainly because it's
          >> simpler.
          >
          > Sure.  I agree!
          > I try to implement it later.
          >
          >
          > 2011/9/8 Bram Moolenaar <Bram@...>:
          >>
          >> Taro Muraoka wrote:
          >>
          >>> Hmm.  It seems too tricky.  How about this more formed idea.
          >>>
          >>> Vim can check type of returned value from completefunc, so vim should
          >>> accept not only array but also dictionary.  For array value, vim use it
          >>> as same as currently.  For dictionary value, vim behaves some parsing on
          >>> it.
          >>>
          >>> For example, 'refresh' means as you wrote, 'candidates' has array of
          >>> completion candidates.
          >>>
          >>>     let l = list-with-complete-items
          >>>     return { 'refresh': 'always', 'candidates': l }
          >>>
          >>> Besides it is extensible for future use.
          >>
          >> Yes, that would work as well.
          >>
          >> Instead of "candidates" I would call it "words".  Mainly because it's
          >> simpler.
          >>
          >> --
          >> For large projects, Team Leaders use sophisticated project management software
          >> to keep track of who's doing what.  The software collects the lies and guesses
          >> of the project team and organizes them in to instantly outdated charts that
          >> are too boring to look at closely.  This is called "planning".
          >>                                (Scott Adams - The Dilbert principle)
          >>
          >>  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
          >> ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          >> \\\  an exciting new programming language -- http://www.Zimbu.org        ///
          >>  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
          >>
          >
          >
          >
          > --
          > MURAOKA Taro <koron.kaoriya@...>
          >



          --
          MURAOKA Taro <koron.kaoriya@...>

          --
          You received this message from the "vim_dev" 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
        Your message has been successfully submitted and would be delivered to recipients shortly.