Hari Krishna Dara wrote:

> Using Vim 70g, I am seeing a weird problem with CursorMoved autocommand.
> In a function, I am removing my CursorMoved autocommand, moving the
> cursor and adding the CursorMoved autocommand back, but the cursor
> movement somehow ends up triggering the autocommand.  At the time of
> cursor movement, there is no way the autocommand could have been
> defined, but instead of using the state at the time of cursor movement,
> the state at the end of the execution of the function is being used.

That's very well possible.  Vim compares the current cursor position to
the one when CursorMoved was last triggered.  And you would get a
trigger right after adding the first CursorMoved autocommand.

Perhaps what you want to do can be done by adding CursorMoved to
'eventignore'?

Or somehow add a flag to the code that is triggered, so that it does nothing.

-- 
I have a drinking problem -- I can't afford it.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to