On 10/5/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
Yakov Lerner wrote:
> CursorHold is suppsed to be triggered in normal mode
> after &updatetime, correct ? But in the scenario below,
> when vim gets into normal mode after insert mode,
> CursorHold is not triggered:
>
> 1. vim -u NONE -U NONE
> 2. :let x=0
> 3. :let ut=200 " just some low value
> 3. :au CursorHold * let x=x+1 | echo x
> 4. <C-E><C-E><C-E> -- watch CursorHold working
> 5. ii<esc> wait .... there's not CursorHold
> ii<esc> wait .... there's not CursorHold
> ii<esc> wait .... there's not CursorHold
>
> Why ? Bug or feature ?
You don't mention the version number. Does it include patch 7.0.104?
Yes
Then this patch should fix it:
*** ../../vim-7.0.118/src/edit.c Tue Oct 3 15:49:20 2006
--- edit.c Thu Oct 5 22:26:27 2006
***************
*** 923,928 ****
--- 923,929 ----
if (cmdchar != 'r' && cmdchar != 'v')
apply_autocmds(EVENT_INSERTLEAVE, NULL, NULL,
FALSE, curbuf);
+ did_cursorhold = FALSE;
#endif
return (c == Ctrl_O);
}
That fixes it, thanks.
Yakov