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

gui quits when it shouldn't

Expand Messages
  • dman
    I just remembered another situation with gvim : The File- Close menu item lists :q as the equivalent keyboard command. Now _sometimes_ File- Close behaves
    Message 1 of 11 , Aug 30, 2001
    • 0 Attachment
      I just remembered another situation with gvim :

      The File->Close menu item lists :q as the equivalent keyboard command.
      Now _sometimes_ File->Close behaves properly, that is it closes the
      file/buffer but doesn't exit. Other times (more frequently) it quits
      (as :q would do).

      Bug or misfeature? I think if I have multiple windows open :q will
      close only the one file (and it's window) but if I have only one
      window it quits (when all I want to do is close the buffer).

      -D
    • Vince Negri
      ... the behaviour of :q does not exactly match what you expect File- Close to do. Perhaps you should edit your menu.vim to map File- Close to :bd - then
      Message 2 of 11 , Aug 31, 2001
      • 0 Attachment
        > Bug or misfeature? I think if I have multiple windows open :q will
        > close only the one file (and it's window) but if I have only one
        > window it quits (when all I want to do is close the buffer).

        :q is behaving as it is designed to do. The problem is that
        the behaviour of :q does not exactly match what you expect
        File->Close to do. Perhaps you should edit your menu.vim
        to map File->Close to :bd - then File->Close with only
        one file will get you back to the [no file] window.

        --
        Vince Negri (vnegri@...)
        Application Solutions Ltd. Tel:+44(0)1273-476608 Fax:+44(0)1273-478888

        Legal Disclaimer: Any views expressed by the sender of this message are
        not necessarily those of Application Solutions Ltd. Information in this
        e-mail may be confidential and is for the use of the intended recipient
        only, no mistake in transmission is intended to waive or compromise such
        privilege. Please advise the sender if you receive this e-mail by mistake.
      • Bram Moolenaar
        ... An alternative would be to use :close . When there is one window only you get an error message: E444: Cannot close last window . Is that better than
        Message 3 of 11 , Aug 31, 2001
        • 0 Attachment
          dman wrote:

          > I just remembered another situation with gvim :
          >
          > The File->Close menu item lists :q as the equivalent keyboard command.
          > Now _sometimes_ File->Close behaves properly, that is it closes the
          > file/buffer but doesn't exit. Other times (more frequently) it quits
          > (as :q would do).
          >
          > Bug or misfeature? I think if I have multiple windows open :q will
          > close only the one file (and it's window) but if I have only one
          > window it quits (when all I want to do is close the buffer).

          An alternative would be to use ":close". When there is one window only
          you get an error message: "E444: Cannot close last window". Is that
          better than exiting?

          --
          Not too long ago, a program was something you watched on TV...

          /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
          ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
          \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
        • dman
          ... No, the Window menu handles closing windows correctly. I want to close a buffer. Vince identified the solution -- I want :confirm bd in menu.vim, not
          Message 4 of 11 , Aug 31, 2001
          • 0 Attachment
            On Fri, Aug 31, 2001 at 02:41:08PM +0200, Bram Moolenaar wrote:
            |
            | dman wrote:
            |
            | > I just remembered another situation with gvim :
            | >
            | > The File->Close menu item lists :q as the equivalent keyboard command.
            | > Now _sometimes_ File->Close behaves properly, that is it closes the
            | > file/buffer but doesn't exit. Other times (more frequently) it quits
            | > (as :q would do).
            | >
            | > Bug or misfeature? I think if I have multiple windows open :q will
            | > close only the one file (and it's window) but if I have only one
            | > window it quits (when all I want to do is close the buffer).
            |
            | An alternative would be to use ":close". When there is one window only
            | you get an error message: "E444: Cannot close last window". Is that
            | better than exiting?

            No, the Window menu handles closing windows correctly. I want to
            close a buffer.

            Vince identified the solution -- I want ":confirm bd" in menu.vim, not
            ":confirm q". (And now I know about ":bd" to use it from the keyboard
            as well :-))

            Thanks!
            -D

            PS. Maybe that change should go into the standard release?
          • Bram Moolenaar
            ... You don t close a buffer. You can stop editing it by hiding or unloading it, or deleting it. Buffers are created and deleted, windows are opened and
            Message 5 of 11 , Aug 31, 2001
            • 0 Attachment
              dman wrote:

              > | > I just remembered another situation with gvim :
              > | >
              > | > The File->Close menu item lists :q as the equivalent keyboard command.
              > | > Now _sometimes_ File->Close behaves properly, that is it closes the
              > | > file/buffer but doesn't exit. Other times (more frequently) it quits
              > | > (as :q would do).
              > | >
              > | > Bug or misfeature? I think if I have multiple windows open :q will
              > | > close only the one file (and it's window) but if I have only one
              > | > window it quits (when all I want to do is close the buffer).
              > |
              > | An alternative would be to use ":close". When there is one window only
              > | you get an error message: "E444: Cannot close last window". Is that
              > | better than exiting?
              >
              > No, the Window menu handles closing windows correctly. I want to
              > close a buffer.

              You don't close a buffer. You can stop editing it by hiding or
              unloading it, or deleting it. Buffers are created and deleted, windows
              are opened and closed.

              > Vince identified the solution -- I want ":confirm bd" in menu.vim, not
              > ":confirm q". (And now I know about ":bd" to use it from the keyboard
              > as well :-))

              If you like it that way, you can use it. But I don't think it's a good
              default for File/Close.

              --
              [clop clop]
              MORTICIAN: Who's that then?
              CUSTOMER: I don't know.
              MORTICIAN: Must be a king.
              CUSTOMER: Why?
              MORTICIAN: He hasn't got shit all over him.
              The Quest for the Holy Grail (Monty Python)

              /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
              ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
              \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
            • dman
              ... What is the difference between unloading and deleting . ... Ok, if you say so (you own the source, after all, and I can always patch my version :-)).
              Message 6 of 11 , Aug 31, 2001
              • 0 Attachment
                On Fri, Aug 31, 2001 at 08:27:54PM +0200, Bram Moolenaar wrote:
                |
                | dman wrote:
                |
                | > | > I just remembered another situation with gvim :
                | > | >
                | > | > The File->Close menu item lists :q as the equivalent keyboard command.
                | > | > Now _sometimes_ File->Close behaves properly, that is it closes the
                | > | > file/buffer but doesn't exit. Other times (more frequently) it quits
                | > | > (as :q would do).
                | > | >
                | > | > Bug or misfeature? I think if I have multiple windows open :q will
                | > | > close only the one file (and it's window) but if I have only one
                | > | > window it quits (when all I want to do is close the buffer).
                | > |
                | > | An alternative would be to use ":close". When there is one window only
                | > | you get an error message: "E444: Cannot close last window". Is that
                | > | better than exiting?
                | >
                | > No, the Window menu handles closing windows correctly. I want to
                | > close a buffer.
                |
                | You don't close a buffer. You can stop editing it by hiding or
                | unloading it, or deleting it. Buffers are created and deleted, windows
                | are opened and closed.

                What is the difference between "unloading" and "deleting".

                | > Vince identified the solution -- I want ":confirm bd" in menu.vim, not
                | > ":confirm q". (And now I know about ":bd" to use it from the keyboard
                | > as well :-))
                |
                | If you like it that way, you can use it. But I don't think it's a good
                | default for File/Close.

                Ok, if you say so (you own the source, after all, and I can always
                patch my version :-)). The way I have it matches the behavior of many
                other apps for File->Close, and is what I expected to happen.

                -D
              • Bram Moolenaar
                ... An unloaded buffer is still in the buffer list. Thus :bnext and similar commands find the file. -- ARTHUR: I am your king! WOMAN: Well, I didn t vote
                Message 7 of 11 , Sep 1, 2001
                • 0 Attachment
                  dman wrote:

                  > | You don't close a buffer. You can stop editing it by hiding or
                  > | unloading it, or deleting it. Buffers are created and deleted, windows
                  > | are opened and closed.
                  >
                  > What is the difference between "unloading" and "deleting".

                  An unloaded buffer is still in the buffer list. Thus ":bnext" and
                  similar commands find the file.

                  --
                  ARTHUR: I am your king!
                  WOMAN: Well, I didn't vote for you.
                  ARTHUR: You don't vote for kings.
                  WOMAN: Well, 'ow did you become king then?
                  The Quest for the Holy Grail (Monty Python)

                  /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                  ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
                  \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                • Mark Waggoner
                  ... It sounds to me like a File/Close menu item is more logically connected to deleting a buffer than closing a window. Windows are connected to buffers,
                  Message 8 of 11 , Sep 5, 2001
                  • 0 Attachment
                    On Fri, 31 Aug 2001, Bram Moolenaar wrote:

                    > dman wrote:
                    >
                    > > | > I just remembered another situation with gvim :
                    > > | >
                    > > | > The File->Close menu item lists :q as the equivalent keyboard command.
                    > > | > Now _sometimes_ File->Close behaves properly, that is it closes the
                    > > | > file/buffer but doesn't exit. Other times (more frequently) it quits
                    > > | > (as :q would do).
                    > > | >
                    > > | > Bug or misfeature? I think if I have multiple windows open :q will
                    > > | > close only the one file (and it's window) but if I have only one
                    > > | > window it quits (when all I want to do is close the buffer).
                    > > |
                    > > | An alternative would be to use ":close". When there is one window only
                    > > | you get an error message: "E444: Cannot close last window". Is that
                    > > | better than exiting?
                    > >
                    > > No, the Window menu handles closing windows correctly. I want to
                    > > close a buffer.
                    >
                    > You don't close a buffer. You can stop editing it by hiding or
                    > unloading it, or deleting it. Buffers are created and deleted, windows
                    > are opened and closed.
                    >
                    > > Vince identified the solution -- I want ":confirm bd" in menu.vim, not
                    > > ":confirm q". (And now I know about ":bd" to use it from the keyboard
                    > > as well :-))
                    >
                    > If you like it that way, you can use it. But I don't think it's a good
                    > default for File/Close.


                    It sounds to me like a File/Close menu item is more logically connected
                    to deleting a buffer than closing a window. Windows are connected to
                    buffers, buffers are connected to files. If it was Window/Close I'd
                    agree that :q or :close makes more sense.

                    --
                    Mark Waggoner |
                    waggoner@... | After all - A person's a person.
                    503-712-3335 | No matter how small.
                    dpg-or.intel.com/~waggoner |
                  • dman
                    ... [ complaint about File- Close snipped ] ... I agree with this, which is why I tweaked $VIM/menu.vim to have :bd for File- Close instead of :q or :close (I
                    Message 9 of 11 , Sep 5, 2001
                    • 0 Attachment
                      On Wed, Sep 05, 2001 at 05:38:50PM -0700, Mark Waggoner wrote:
                      | On Fri, 31 Aug 2001, Bram Moolenaar wrote:
                      | > dman wrote:

                      [ complaint about File->Close snipped ]

                      | > > No, the Window menu handles closing windows correctly. I want to
                      | > > close a buffer.
                      | >
                      | > You don't close a buffer. You can stop editing it by hiding or
                      | > unloading it, or deleting it. Buffers are created and deleted, windows
                      | > are opened and closed.
                      | >
                      | > > Vince identified the solution -- I want ":confirm bd" in menu.vim, not
                      | > > ":confirm q". (And now I know about ":bd" to use it from the keyboard
                      | > > as well :-))
                      | >
                      | > If you like it that way, you can use it. But I don't think it's a good
                      | > default for File/Close.
                      |
                      | It sounds to me like a File/Close menu item is more logically connected
                      | to deleting a buffer than closing a window. Windows are connected to
                      | buffers, buffers are connected to files. If it was Window/Close I'd
                      | agree that :q or :close makes more sense.

                      I agree with this, which is why I tweaked
                      $VIM/menu.vim
                      to have :bd for File->Close instead of :q or :close (I noticed that
                      changed for 60au).

                      I don't think it is a big enough deal to argue about it, but if you
                      want to "fix" (<wink>) your own installation, $VIM/menu.vim is the
                      place to do it. Just search for "Close" and that is the line. It is
                      pretty intuitive how to change it.

                      HTH,
                      -D
                    • Bram Moolenaar
                      ... I now thought of another solution: Use :close when there are several windows, but use :enew when there is only one window. That looks a lot like
                      Message 10 of 11 , Sep 6, 2001
                      • 0 Attachment
                        Dman wrote:

                        > | > > Vince identified the solution -- I want ":confirm bd" in menu.vim, not
                        > | > > ":confirm q". (And now I know about ":bd" to use it from the keyboard
                        > | > > as well :-))
                        > | >
                        > | > If you like it that way, you can use it. But I don't think it's a good
                        > | > default for File/Close.
                        > |
                        > | It sounds to me like a File/Close menu item is more logically connected
                        > | to deleting a buffer than closing a window. Windows are connected to
                        > | buffers, buffers are connected to files. If it was Window/Close I'd
                        > | agree that :q or :close makes more sense.
                        >
                        > I agree with this, which is why I tweaked
                        > $VIM/menu.vim
                        > to have :bd for File->Close instead of :q or :close (I noticed that
                        > changed for 60au).

                        I now thought of another solution: Use ":close" when there are several
                        windows, but use ":enew" when there is only one window. That looks a
                        lot like ":bdelete", but without the side effect of removing the buffer
                        from the buffer list.

                        Try this patch:

                        *** ../vim-6.0au/runtime/menu.vim Sun Sep 2 19:28:42 2001
                        --- runtime/menu.vim Thu Sep 6 11:11:09 2001
                        ***************
                        *** 80,86 ****
                        amenu 10.310 &File.&Open\.\.\.<Tab>:e :browse confirm e<CR>
                        amenu 10.320 &File.Sp&lit-Open\.\.\.<Tab>:sp :browse sp<CR>
                        amenu 10.325 &File.&New<Tab>:enew :confirm enew<CR>
                        ! amenu 10.330 &File.&Close<Tab>:close :confirm close<CR>
                        amenu 10.335 &File.-SEP1- :
                        amenu 10.340 &File.&Save<Tab>:w :confirm w<CR>
                        amenu 10.350 &File.Save\ &As\.\.\.<Tab>:sav :browse confirm saveas<CR>
                        --- 80,91 ----
                        amenu 10.310 &File.&Open\.\.\.<Tab>:e :browse confirm e<CR>
                        amenu 10.320 &File.Sp&lit-Open\.\.\.<Tab>:sp :browse sp<CR>
                        amenu 10.325 &File.&New<Tab>:enew :confirm enew<CR>
                        ! amenu <silent> 10.330 &File.&Close<Tab>:close
                        ! \ :confirm if winheight(2) < 0 <Bar>
                        ! \ enew <Bar>
                        ! \ else <Bar>
                        ! \ close <Bar>
                        ! \ endif<CR>
                        amenu 10.335 &File.-SEP1- :
                        amenu 10.340 &File.&Save<Tab>:w :confirm w<CR>
                        amenu 10.350 &File.Save\ &As\.\.\.<Tab>:sav :browse confirm saveas<CR>

                        --
                        BEDEVERE: Why do you think she is a witch?
                        SECOND VILLAGER: She turned me into a newt.
                        BEDEVERE: A newt?
                        SECOND VILLAGER: (After looking at himself for some time) I got better.
                        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                        ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
                        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                      • dman
                        ... But I _want_ the buffer removed from the buffer list :-). :confirm bd is the exact behavior I want, which is what my installation will be :-). -D
                        Message 11 of 11 , Sep 6, 2001
                        • 0 Attachment
                          On Thu, Sep 06, 2001 at 01:09:44PM +0200, Bram Moolenaar wrote:

                          | I now thought of another solution: Use ":close" when there are several
                          | windows, but use ":enew" when there is only one window. That looks a
                          | lot like ":bdelete", but without the side effect of removing the buffer
                          | from the buffer list.

                          But I _want_ the buffer removed from the buffer list :-).
                          ":confirm bd" is the exact behavior I want, which is what my
                          installation will be :-).

                          -D
                        Your message has been successfully submitted and would be delivered to recipients shortly.