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

43325Re: completeopt: menu|menuone + longest = bug?

Expand Messages
  • Bram Moolenaar
    May 1, 2006
    • 0 Attachment
      Eric Van Dewoestine wrote:

      > Tested with vim70g
      > Given the following file contents:
      > BlahBlahImpl
      > BlahBlah.Type
      > If I try to perform the following on a new line at the end of the file
      > Bl<c-x><c-n or p>.T<c-n or p>
      > The resulting text should be
      > BlahBlah.Type
      > However, if my 'completeopt' has menu and longest, or menuone and
      > longest, I get unexpected results.
      > Case 1:
      > Bl<c-x><c-n>.T<c-n>
      > Results in:
      > BlahBlah.T
      > Vim Message = "Back at original"
      > Subsiquent <c-n> calls have no effect.
      > Case 2:
      > Bl<c-x><c-p>.T<c-p>
      > Results in:
      > Bl
      > Vim Message = "Back at original"
      > Subsiquent <c-p> calls have no effect.
      > This case is even worse than the first since my previously completed
      > BlahBlah text is now gone.
      > Note: I tested the above by simply starting vim as follows:
      > To show unexpected behavior:
      > vi -u NONE -c "set completeopt=menu,longest"
      > To show expected behavior:
      > vi -u NONE -c "set completeopt=longest"
      > or
      > vi -u NONE -c "set completeopt=menu"

      I know about this: When you type the "." and there no complete
      match was inserted (showing the longest common text in this example),
      Vim assumes you are extending the text to reduce the list of matches.
      Thus the completion still starts at "BlahBlah".

      You need to stop completion somehow, e.g., with a space and backspace.

      This is not a nice way to work. I thought of having all punctuation
      characters stop completion, but that breaks completion of items where
      punctuation can be part of the match (e.g., () for functions).

      The problem with political jokes is that they get elected.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
    • Show all 7 messages in this topic