Wednesday, March 24, 2010

Re: Problem of frequency call of func through --remote-expr

On Mar 24, 4:48 am, "Christian Brabandt" <cbli...@256bit.org> wrote:
>
> Yes, Simply call feedkeys in your autocommand and put in some key, that
> won't hurt. Something like this may be:
>
> fu! s:Run()
>    let k_refresh="\x0c" " this is ctrl-l
>    " Do whatever you want to be done here
>    echomsg strftime("%H:%M:%S ") . "Autocommand triggered"
>    call feedkeys(k_refresh, 't')
> endfu
>
> augroup RunContinuously
>   au!
>   au CursorHold * :call s:Run()
> augroup end
>
> I am not sure, how invasive this will be for the user, though.
>

I think it would be pretty invasive. It will make not just the desired
script, but ALL CursorHold events, to fire without end. I imagine some
plugins rely on the fact that CursorHold only fires once after cursor
inactivity, though I don't know any specific ones. Most likely this
will only cause inefficiencies, doing work multiple times instead of
just once, but there might be cases where it actually screws things up.

--
You received this message from the "vim_use" 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

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

No comments: