-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
source $MYVIMRC when Async runing background cause infinite prompt error messge #237
Comments
I ran into the above when using AsyncRun in a post-update hook of junegunn/vim-plug. Along the lines of:
And calling EDIT: The contents of the s:async_info dictionary printed line 558 just before the
I'll keep looking around for the logic bug or a workaround. |
Internal states have been reseted when sourcing your asyncrun.vim make sure to use AsyncStop before reloading asyncrun.vim |
Found a workaround in my case, no more apparent problems. To my knowledge I didn't source asyncrun.vim a second time, as I call AsyncRun only once within the junegunn/vim-plug post-update hook in that BuildNodeJs function I wrote above, which runs within one of vim-plug's jobs/threads:
I realized vim-plug already updates the plugins asynchronously, so, there was no point in using AsyncRun on top of that in async mode, it should be fine sync. So my workaround is to use
I'm using Vim 8.2. Both vim-plug and AsyncRun appear to use the Vim +job features, and somehow... there is a concurrency issue beyond my understanding. Like s:async_info is indeed populated but isn't accessible in the relevant +job thread? Or, maybe asyncrun.vim is is indeed sourced a 2nd time, somehow, which my tracing seems to indicate. Anyway, problem solved for me with the sync If curious, some tracing messages in my testing:
That apparent second parsing also appears when using the sync |
Turns out that in my case asyncrun.vim is indeed sourced a second time. When I tried to use Would you consider adding a header guard to if exists('g:sourced_asyncrun_plugin') | finish | endif
let g:sourced_asyncrun_plugin = 1 In my case I am unable to tell how/why it is being sourced a second time. I had changed: Plug 'skywind3000/asyncrun.vim', { 'on': ['AsyncRun!', 'AsyncRun'] } To: Plug 'skywind3000/asyncrun.vim' Yet somehow Plug 'nodejs/node', { 'do': function('BuildNodeJs') } Anyway, the proposed header guard fixes the problem for me. |
Error detected while processing function AsyncRun_Job_OnTimer:
line 11:
E716: Key not present in Dictionary: "once == 0"
Press ENTER or type command to continue
Error detected while processing function AsyncRun_Job_OnTimer:
The text was updated successfully, but these errors were encountered: