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

vim cannot quit after certain tabs manipulation

Expand Messages
  • Yakov Lerner
    After certain 3-step manipulation with tabs, can t quit vim with :q!. (vim 7.0.42). Tabline is not updated properly. % vim -u NONE -U NONE ix
    Message 1 of 5 , Aug 6 9:25 AM
      After certain 3-step manipulation with tabs,
      can't quit vim with :q!. (vim 7.0.42). Tabline is
      not updated properly.

      % vim -u NONE -U NONE
      ix<esc> " make 1st buffer modified
      :tabnew<cr> " create 2nd tab
      ix<esc> " make 2nd buffer modified
      :tabclose! 1 "delete non-last tab

      " ^^^ watch the tabline after tabclose command.
      " PROBLEM #1 here: tabline shows 2 tabs but this is
      " wrong; only 1 tab exist at this point
      :tabs " confirm that ony 1 tab exists

      :q!
      E37: No write since last change (add ! to override)
      E162: No write since last change for buffer "[No Name]"
      "^^^^^ PROBLEM #2: can't quit vim here, must resort to kill

      Yakov
    • A.J.Mechelynck
      ... My own text-style tabline (recently published one one of these lists) shows only one tab. Also, in gvim -u NONE the tabline disappears at this point,
      Message 2 of 5 , Aug 6 10:05 AM
        Yakov Lerner wrote:
        > After certain 3-step manipulation with tabs,
        > can't quit vim with :q!. (vim 7.0.42). Tabline is
        > not updated properly.
        >
        > % vim -u NONE -U NONE
        > ix<esc> " make 1st buffer modified
        > :tabnew<cr> " create 2nd tab
        > ix<esc> " make 2nd buffer modified
        > :tabclose! 1 "delete non-last tab
        >
        > " ^^^ watch the tabline after tabclose command.

        My own text-style tabline (recently published one one of these lists)
        shows only one tab. Also, in gvim -u NONE the tabline disappears at this
        point, meaning there is only one tab. I'm using a "Huge" 7.0.42 with
        GTK2-GNOME GUI. However, with gvim -u NONE I notice a long delay before
        the tab bar changes from "Empty" to "[No Name + ][No Name + ]" and the
        cursor returns from the command-line to the file window when _opening_
        the 2nd tab.

        What version/patchlevel of Vim 7 are you using? Have you set 'tabline'
        'showtabline' and/or the e flag of 'guioptions', and to what? What do
        you see with -u NONE ?

        > " PROBLEM #1 here: tabline shows 2 tabs but this is
        > " wrong; only 1 tab exist at this point
        > :tabs " confirm that ony 1 tab exists
        >
        > :q!
        > E37: No write since last change (add ! to override)
        > E162: No write since last change for buffer "[No Name]"
        > "^^^^^ PROBLEM #2: can't quit vim here, must resort to kill
        >
        > Yakov
        >
        >

        After ":tabclose! 1" the modified buffer in the closed tab is hidden,
        not abandoned (just like with ":only!"). Thus you cannot quit Vim except
        with ":qa!" (which works, I checked), or by bringing the hidden buffer
        to the front and quit!ting it, writing it, or otherwise making it
        unmodified (e.g. ":set nomod" or undo all changes).

        After closing tab 1, ":ls!" shows 2 modified buffers, the first of which
        is hidden. After ":q!" I see two buffers, the second of which is hidden.
        Doing ":q!" again swaps them again. ":enew!" followed by ":q!" brings
        (with an error) the modified buffer to the front, with two other buffers
        (both unhidden and unmodified) in the buffer list. Now ":q!" or ":enew!
        | q" closes Vim.



        Best regards,
        Tony.
      • Yakov Lerner
        ... This *is* with -u NONE, Antonie. This is console vim, In gvim, tabline is refreshed as expected. In console vim -u NONE, tabline is not refreshed. vim
        Message 3 of 5 , Aug 6 12:33 PM
          On 8/6/06, A.J.Mechelynck <antoine.mechelynck@...> wrote:
          > Yakov Lerner wrote:

          > > % vim -u NONE -U NONE
          > > ix<esc> " make 1st buffer modified
          > > :tabnew<cr> " create 2nd tab
          > > ix<esc> " make 2nd buffer modified
          > > :tabclose! 1 "delete non-last tab
          > >
          > > " ^^^ watch the tabline after tabclose command.
          > What do you see with -u NONE ?

          This *is* with -u NONE, Antonie. This is console vim,
          In gvim, tabline is refreshed as expected. In console vim -u NONE,
          tabline is not refreshed. vim 7.0.42.

          >
          > > " PROBLEM #1 here: tabline shows 2 tabs but this is
          > > " wrong; only 1 tab exist at this point
          > > :tabs " confirm that ony 1 tab exists
          > >
          > > :q!
          > > E37: No write since last change (add ! to override)
          > > E162: No write since last change for buffer "[No Name]"
          > > "^^^^^ PROBLEM #2: can't quit vim here, must resort to kill

          You're right, :qa! quits.

          Yakov
        • A.J.Mechelynck
          ... [...] Hm. In console Vim, I see the tab line still showing 2 tabs. After Ctrl-L it disappears, but the text doesn t go up (there is a blank line where the
          Message 4 of 5 , Aug 6 12:56 PM
            Yakov Lerner wrote:
            > On 8/6/06, A.J.Mechelynck <antoine.mechelynck@...> wrote:
            >> Yakov Lerner wrote:
            >
            >> > % vim -u NONE -U NONE
            >> > ix<esc> " make 1st buffer modified
            >> > :tabnew<cr> " create 2nd tab
            >> > ix<esc> " make 2nd buffer modified
            >> > :tabclose! 1 "delete non-last tab
            >> >
            >> > " ^^^ watch the tabline after tabclose command.
            >> What do you see with -u NONE ?
            >
            > This *is* with -u NONE, Antonie. This is console vim,
            > In gvim, tabline is refreshed as expected. In console vim -u NONE,
            > tabline is not refreshed. vim 7.0.42.
            [...]

            Hm. In console Vim, I see the tab line still showing 2 tabs. After
            Ctrl-L it disappears, but the text doesn't go up (there is a blank line
            where the tabs used to be). Setting 'showtabline' to 2 then back to 1
            restores the display to what it should be.

            With 'showtabline' set to 2 before opening and closing tabs, the tab
            line is updated as it should, even with (otherwise) -u NONE in console Vim

            Hmm... Sounds like a bug to me.



            Best regards,
            Tony.
          • Bill McCarthy
            ... Confirmed the problem even in nocp mode. Started the console version with: vim -u NONE -N After following your instructions and typing :tabs the tabs
            Message 5 of 5 , Aug 6 11:48 PM
              On Sun 6-Aug-06 11:25am -0600, Yakov Lerner wrote:

              > After certain 3-step manipulation with tabs,
              > can't quit vim with :q!. (vim 7.0.42). Tabline is
              > not updated properly.
              >
              > % vim -u NONE -U NONE
              > ix<esc> " make 1st buffer modified
              > :tabnew<cr> " create 2nd tab
              > ix<esc> " make 2nd buffer modified
              > :tabclose! 1 "delete non-last tab
              >
              > " ^^^ watch the tabline after tabclose command.
              > " PROBLEM #1 here: tabline shows 2 tabs but this is
              > " wrong; only 1 tab exist at this point
              > :tabs " confirm that ony 1 tab exists
              >
              > :q!
              > E37: No write since last change (add ! to override)
              > E162: No write since last change for buffer "[No Name]"
              > "^^^^^ PROBLEM #2: can't quit vim here, must resort to kill

              Confirmed the problem even in 'nocp' mode. Started the
              console version with:

              vim -u NONE -N

              After following your instructions and typing ":tabs" the
              tabs were gone but a blank unreachable line remained.

              I received the same message in response to ":q!" but was
              able to get out with:

              :set nomod
              :q!

              Even with 'nomod' I couldn't get out with just ":q" (same
              two line error message).

              --
              Best regards,
              Bill
            Your message has been successfully submitted and would be delivered to recipients shortly.