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

Segfaults on omnifunc completions with "set completeopt+=longest"

Expand Messages
  • nsf
    It looks like someone has changed the logic of the longest match in vim autocompletion. Now it tries to do the longest match after each new letter entered. And
    Message 1 of 3 , Sep 2, 2011
      It looks like someone has changed the logic of the longest match in vim
      autocompletion. Now it tries to do the longest match after each new
      letter entered. And there are some ugly bugs which causes it to
      segfault the vim. Not mentioning that it's also very slow now. Looks
      like it calls omnifunc with every character entered.

      Probably this commit causes the problem:
      http://code.google.com/p/vim/source/detail?r=44ffd0a8abcdba441216514cb711649eb1169876

      Vim version: 7.3.289
      Looks like it only appears when "set completeopt+=longest" is set.

      Steps to reproduce: it's very easy to reproduce this bug with the
      option mentioned above + one of my omnifunc plugins: ccode (C/C++
      completion based on clang) or gocode (Go completion). Both worked just
      fine with previous version of vim + the interaction with vim is
      minimal, therefore they shouldn't really cause a segfault by themselves.

      Bug appears on both x86 and amd64. Plus confirmed by at least one other
      person.

      --
      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
    • Sergey Khorev
      ... Yes, the motivation behind this patch looks somewhat counter-intuitive (http://groups.google.com/group/vim_dev/browse_thread/thread/86643b0112664dfe) Why
      Message 2 of 3 , Sep 5, 2011
        > It looks like someone has changed the logic of the longest match in vim
        > autocompletion. Now it tries to do the longest match after each new
        > letter entered. And there are some ugly bugs which causes it to
        > segfault the vim. Not mentioning that it's also very slow now. Looks
        > like it calls omnifunc with every character entered.
        >
        > Probably this commit causes the problem:
        > http://code.google.com/p/vim/source/detail?r=44ffd0a8abcdba441216514cb711649eb1169876

        Yes, the motivation behind this patch looks somewhat counter-intuitive
        (http://groups.google.com/group/vim_dev/browse_thread/thread/86643b0112664dfe)
        Why on Earth a completion of "a" would be "foo1", "foo2", "foo3" but
        "bar1", "bar2", "bar3" for "ab"?
        If there really is a reason to behave like that we'd better to
        implement this somehow else. E.g., the completion function could
        return an extra value which says that the function wants to be invoked
        every time a user types a letter.

        --
        Sergey Khorev
        http://sites.google.com/site/khorser
        Can anybody think of a good tagline I can steal?

        --
        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
        Some guy calling himself no.snile.face wrote: [BTW: please use your real name on this maillist] ... I ll revert the patch for now. There should be a better
        Message 3 of 3 , Sep 5, 2011
          Some guy calling himself no.snile.face wrote:

          [BTW: please use your real name on this maillist]

          > It looks like someone has changed the logic of the longest match in vim
          > autocompletion. Now it tries to do the longest match after each new
          > letter entered. And there are some ugly bugs which causes it to
          > segfault the vim. Not mentioning that it's also very slow now. Looks
          > like it calls omnifunc with every character entered.
          >
          > Probably this commit causes the problem:
          > http://code.google.com/p/vim/source/detail?r=44ffd0a8abcdba441216514cb711649eb1169876
          >
          > Vim version: 7.3.289
          > Looks like it only appears when "set completeopt+=longest" is set.
          >
          > Steps to reproduce: it's very easy to reproduce this bug with the
          > option mentioned above + one of my omnifunc plugins: ccode (C/C++
          > completion based on clang) or gocode (Go completion). Both worked just
          > fine with previous version of vim + the interaction with vim is
          > minimal, therefore they shouldn't really cause a segfault by themselves.
          >
          > Bug appears on both x86 and amd64. Plus confirmed by at least one other
          > person.

          I'll revert the patch for now. There should be a better solution for
          the original problem.

          --
          BEDEVERE: And that, my lord, is how we know the Earth to be banana-shaped.
          "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

          /// 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
        Your message has been successfully submitted and would be delivered to recipients shortly.