Einar Lielmanis wrote:

> Encrypted file contents are destroyed, if something (e.g autocmd)
> triggers write event, while user is being asked for password.
> 
> To repro:
> 1. have an encrypted.txt ready (:X)
> 2. gvim, :au focuslost * w
> 3. :e encrypted.txt, don't type in the password yet,
> 4. lose window focus, e.g via switching to another window, to trigger
>    the focuslost event,
> 
> Expected:
> The file hasn't changed, so it should stay unmodified,
> 
> Actual behavior:
> encrypted.txt is truncated to a zero size.

Doing a ":write" on FocusLost is a bad idea.  Perhaps ":update" would be
acceptable, but generally a FocusLost event should not do something like
this, because it can happen at any time.

-- 
>From "know your smileys":
 :-)    Funny
 |-)    Funny Oriental
 (-:    Funny Australian

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui