Hirohito Higashi wrote:
> Hi Bram and Vimmers,
>
> I modified a document of ":q!".
>
> Because, The following behaviors were hardly understand when I refer to the
> documentation of ':q!'.
>
> (1) Start vim, new files a.txt and b.txt is displayed in the each window.
> $ vim -N -u NONE -o a.txt b.txt
>
> (2) Modified the both buffer.
> ia<Esc><C-W><C-W>ib<Esc>
>
> (3) Buffer a.txt becomes hidden.
> :only!
>
> (4) Abandon the buffer b.txt
> :q!
> (But, it was not executed. Occuers E37 and E162 and buffer changes a.txt)
>
> (5) Abandon the buffer b.txt
> :q!
> (But, it was not executed. Occuers E37 and E162 and buffer changes b.txt)
>
> ...Repeat (4) and (5).
>
>
> Bram, Is this the intended behavior?
> If Yes, Please consider attached documentation patch.
Thanks for the suggestion. The behavior looks OK, but it's a bit
inconsistent. When editing three files in three windows, making a
change in each buffer, then hiding the first one, you see two windows
with a changed buffer. Then ":q!" abandons a buffer and it is no longer
marked as modified. But using ":q!" in the last window switches to the
hidden changed buffer without marking the current buffer as not
modified. Thus typing ":q!" again will switch to the other buffer,
that's not what the user intended.
So this sequence:
vim -o a.txt b.txt c.txt
[make a change in each window]
:hide (hides a.txt, still modified)
:q! (removes modified flag from b.txt, only see c.txt now)
:q! (error, switches to a.txt)
:q! (error, switches to c.txt)
etc.
Would there be a problem to have ":q!" always mark the current buffer as
not modified, so that one can exit by typing ":q!" again?
Then the behavior would be:
vim -o a.txt b.txt c.txt
[make a change in each window]
:hide (hides a.txt, still modified)
:q! (removes modified flag from b.txt, only see c.txt now)
:q! (removes modified flag from c.txt, error, switches to a.txt)
:q! (exits)
--
Sorry, no fortune today.
/// Bram Moolenaar -- [email protected] -- 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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.