On 2014-02-21, Bram Moolenaar wrote:
> Christian Brabandt wrote:
>
> > Gary,
> >
> > Am 2014-02-17 23:52, schrieb Gary Johnson:
> > > Thanks for your patience with this and willingness to work it
> > > through. I think we're still not on the same page, however.
> > >
> > > In my example I use the following autocommand:
> > >
> > > au BufWinEnter * let a=line(".")
> > >
> > > Let us assume that you are correct that this autocommand triggers
> > > twice, once for the creation of buffer 1 and once for the creation
> > > of buffer 2. After the creation of buffer 2, 'a' should contain the
> > > value of some line number in buffer 2.
> >
> > You are correct, I haven't thought about that. One would expect the
> > autocommand to trigger, after the cursor is positioned on the error,
> > but in fact it is triggered, when the file is loaded but before the
> > cursor is moved to the error.
> >
> > One could consider this a bug. I am however sure, that once we fix
> > this behaviour, there are many more cases were we need to postpone the
> > BufWinEnter autocommand until the cursor is finally moved to the
> > correct position.
> >
> > But hey, no risk, no fun ;)
> > so here is a patch, that prevents this behaviour in your case.
>
> I don't see where it is mentioned that BufWinEnter gets triggered after
> positioning the cursor. I don't think we can guarantee that. It's
> triggered after a buffer is loaded into a window. It's supposed to be
> used for any specific settings you want to apply to the window.
Nothing says explicitly that BufWinEnter gets triggered after the
cursor is positioned. I inferred that from "After a buffer is
displayed in a window" since I never see anything displayed in a
window until after the cursor has been positioned.
> I think this patch makes it too complicated.
Is there a method you would recommend for executing a function or
otherwise being notified after the cursor is positioned?
Regards,
Gary
--
--
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/groups/opt_out.