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

Discrepancy when using 'longest' or not as a complete option

Expand Messages
  • Fran├žois Ingelrest
    Hi, It seems that Vim does not have the same behavior depending on whether longest is used as a complete option. When using set completeopt=menu , if I use
    Message 1 of 3 , Feb 6, 2008
      Hi,

      It seems that Vim does not have the same behavior depending on whether
      "longest" is used as a complete option.

      When using "set completeopt=menu", if I use <c-n> and there's only one
      possible completion, the current word is completed without showing the
      menu and I'm immediately out of the completion mode.

      When using "set completeopt=menu,longest", if I use <c-n> and there's
      only one possible completion, the current word is completed without
      showing the menu and I'm stuck into completion mode. The status line
      says "-- Keyword completion (^N^P) Back at original" and even if I
      type new characters (except a space), I can no longer use <c-n> until
      I stop the completion mode by hand (<c-e>). While this may not be a
      problem with text files, it is very annoying when programming.

      For instance, when typing:

      myTab[myIndex]

      If I use <c-n> to complete "myTab" and that's the only possibility,
      then I cannot use it to complete "myIndex" unless I hit <c-e>.

      IMHO, either Vim should get out of the completion mode after the first
      completion, or it should consider that a character such as '[' stops
      the completion mode (as a space does).

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... What version of Vim? Especially patch 7.1.145 matters. -- An operatingsystem is just a name you give to the rest of bloating idiosyncratic
      Message 2 of 3 , Feb 6, 2008
        Francois Ingelrest wrote:

        > It seems that Vim does not have the same behavior depending on whether
        > "longest" is used as a complete option.
        >
        > When using "set completeopt=menu", if I use <c-n> and there's only one
        > possible completion, the current word is completed without showing the
        > menu and I'm immediately out of the completion mode.
        >
        > When using "set completeopt=menu,longest", if I use <c-n> and there's
        > only one possible completion, the current word is completed without
        > showing the menu and I'm stuck into completion mode. The status line
        > says "-- Keyword completion (^N^P) Back at original" and even if I
        > type new characters (except a space), I can no longer use <c-n> until
        > I stop the completion mode by hand (<c-e>). While this may not be a
        > problem with text files, it is very annoying when programming.
        >
        > For instance, when typing:
        >
        > myTab[myIndex]
        >
        > If I use <c-n> to complete "myTab" and that's the only possibility,
        > then I cannot use it to complete "myIndex" unless I hit <c-e>.
        >
        > IMHO, either Vim should get out of the completion mode after the first
        > completion, or it should consider that a character such as '[' stops
        > the completion mode (as a space does).

        What version of Vim? Especially patch 7.1.145 matters.

        --
        An operatingsystem is just a name you give to the rest of bloating
        idiosyncratic machine-based-features you left out of your editor.
        (author unknown)

        /// 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 ///

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Fran├žois Ingelrest
        ... I was using v7.1.56 (Ubuntu Gutsy). I ve just tested with v7.1.241 and this version indeed correctly stops the completion when a new character is typed.
        Message 3 of 3 , Feb 6, 2008
          > > It seems that Vim does not have the same behavior depending on whether
          > > "longest" is used as a complete option.
          > >
          > > When using "set completeopt=menu", if I use <c-n> and there's only one
          > > possible completion, the current word is completed without showing the
          > > menu and I'm immediately out of the completion mode.
          > >
          > > When using "set completeopt=menu,longest", if I use <c-n> and there's
          > > only one possible completion, the current word is completed without
          > > showing the menu and I'm stuck into completion mode. The status line
          > > says "-- Keyword completion (^N^P) Back at original" and even if I
          > > type new characters (except a space), I can no longer use <c-n> until
          > > I stop the completion mode by hand (<c-e>). While this may not be a
          > > problem with text files, it is very annoying when programming.
          > >
          > > For instance, when typing:
          > >
          > > myTab[myIndex]
          > >
          > > If I use <c-n> to complete "myTab" and that's the only possibility,
          > > then I cannot use it to complete "myIndex" unless I hit <c-e>.
          > >
          > > IMHO, either Vim should get out of the completion mode after the first
          > > completion, or it should consider that a character such as '[' stops
          > > the completion mode (as a space does).
          >
          > What version of Vim? Especially patch 7.1.145 matters.

          I was using v7.1.56 (Ubuntu Gutsy). I've just tested with v7.1.241 and
          this version indeed correctly stops the completion when a new
          character is typed.

          Sorry for the outdated report, I should have tested with the latest
          version first. Lesson learnt.

          --~--~---------~--~----~------------~-------~--~----~
          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.