On Jul 15, 9:18 am, Andy Wokula <[EMAIL PROTECTED]> wrote:
> Ben Fritz schrieb:
>
> > Consider:
>
> > augroup misc
> > au!
> > autocmd VimEnter * augroup misc | exec 'autocmd WinEnter * let
> > w:created=1' | augroup END
> > augroup END
>
> > The "augroup END" contained within the autocmd matches as the end
> > pattern for the vimAugroup syntax item. This causes the real end of
> > the augroup to not be highlighted, and it also ends the fold for the
> > augroup prematurely.
>
> A very rare case, isn't it? You can rewrite this as
>
> augroup misc
> au!
> autocmd VimEnter * autocmd misc WinEnter * let w:created = 1
> augroup END
>
I actually missed the [group] for autocmd. Whoops, this is a better
form. The syntax bug still exists though.
> " or even
>
> augroup misc
> au!
> autocmd WinEnter * let w:created = 1
> augroup END
>
> " Actually, I don't see how this differs from the first autocmd.
>
> --
> Andy
This differs because, by having a VimEnter autocmd define the WinEnter
autocmd, I ensure that the WinEnter autocmd is defined _after_ all my
other autocmds regardless of where they are defined (unless I define
them in similar fashion, using VimEnter).
This order is important, because I want to check the non-existence of
w:created in other autocmds as a way of detecting the very first time
the window is entered.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---