Sunday, March 27, 2011

Re: Strange Tab Behaviour When Cancelling a Close-Window

On 26 March 2011 22:16, Bram Moolenaar <Bram@moolenaar.net> wrote:
>
> When you try to exit and there is a modified buffer, Vim will try to
> show you that modified buffer in the current window, so that you can see
> what it is and possibly write it.  That's intentional.

Understood. However, I must note that the modified buffer is shown
after I click on "Cancel", but NOT before. Also, the buffer brought
to the new tab is always displayed from the top, with the cursor on
line 1, column 1. So the effect is not that good.

> Autocommands can always cause things to go wrong.  You need to take care
> about that when writing them.  Especially when using commands such as
> ":q!".
>
> You do need to use BufWinEnter to do something after the modelines, but
> it's also triggered when displaying a buffer in any window.  You could
> set a b: variable to flag whether it's the first time.

Thanks. I have modified my plugin accordingly, and it seems to work
(at least no data loss now).

Best regards,

Yongwei

--
Wu Yongwei
URL: http://wyw.dcweb.cn/

--
You received this message from the "vim_use" 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

No comments:

Post a Comment