Tyru wrote:

> On Sun, Mar 27, 2016 at 5:00 AM, Bram Moolenaar <[email protected]> wrote:
> >
> > Patch 7.4.1658
> > Problem:    A plugin does not know when VimEnter autocommands were already
> >             triggered.
> > Solution:   Add the v:vim_did_enter variable.
> > Files:      src/eval.c, src/main.c, src/vim.h, src/testdir/test_autocmd.vim,
> >             src/testdir/test_alot.vim, runtime/doc/autocmd.txt,
> >             runtime/doc/eval.txt
> 
> When is this variable needed?
> !has('vim_starting') or checking by autocommand looks enough for me.
> 
>     autocmd VimEnter * let s:vim_did_enter = 1
> 
>     if exists('s:vim_did_enter')
>       ...
>     endif

That does not work, since the VimEnter event won't trigger twice.

!has('vim_starting') does do almost the same thing, but as Gary mentioned
it's quite unexpected to use has() for this.  So perhaps we should keep
v:vim_did_enter.


-- 
"The sun oozed over the horizon, shoved aside darkness, crept along the
greensward, and, with sickly fingers, pushed through the castle window,
revealing the pillaged princess, hand at throat, crown asunder, gaping
in frenzied horror at the sated, sodden amphibian lying beside her,
disbelieving the magnitude of the frog's deception, screaming madly,
"You lied!"
    - Winner of the Bulwer-Lytton contest (San Jose State University),
      wherein one writes only the first line of a bad novel

 /// 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.

Raspunde prin e-mail lui