unblevable / quick-scope

Lightning fast left-right movement in Vim
MIT License
1.43k stars 54 forks source link

Throws error if invoked while a background asynchronous process is running (with skywind3000/asyncrun.vim) #39

Open nmder opened 7 years ago

nmder commented 7 years ago

The following error message is shown: **Start Error*** Messages maintainer: Bram Moolenaar Bram@vim.org "~/NLP/masters_thesis/main.tex" 525L, 24390C "main.tex" 525L, 24390C written Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update: line 26: E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update[46]..23_AsyncRun_Job_AutoScroll: line 6: E523: Not allowed here: ^I^Icbottom Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update: line 26: E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update[46]..23_AsyncRun_Job_AutoScroll: line 6: E523: Not allowed here: ^I^Icbottom Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update: line 26: E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update[46]..23_AsyncRun_Job_AutoScroll: line 6: E523: Not allowed here: ^I^Icbottom Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update: line 26: E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update[46]..23_AsyncRun_Job_AutoScroll: line 6: E523: Not allowed here: ^I^Icbottom Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update: line 26: E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update[46]..23_AsyncRun_Job_AutoScroll: line 6: E523: Not allowed here: ^I^Icbottom Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update: line 26: E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text E523: Not allowed here: ^I^I^I^Icaddexpr l:text Error detected while processing function 41_aim[29]..AsyncRun_Job_OnTimer[11]..23_AsyncRun_Job_Update[46]..23_AsyncRun_Job_AutoScroll: line 6: E523: Not allowed here: ^I^Icbottom **End Error****

bradford-smith94 commented 6 years ago

Sorry for not commenting on this sooner, I wanted to get #40 merged before hunting down other bugs.

I was able to reproduce this (although by now, not using the current version of AsyncRun); however, upon close inspection I'm not really sure if this error is quick-scope's fault.

The errors get thrown when processing quick-scope actions but they reference lines from AsyncRun. Specifically this line in AsyncRun_Job_Update and this one in AsyncRun_Job_AutoScroll. Not being an expert on how AsyncRun works I cannot say for sure, but I think these errors have something to do with AsyncRun trying to populate and modify the quickfix list while quick-scope is in the middle of a command.

Also interesting, the error Vim throws in this case (E523) references the 'secure' option, which doesn't seem to relate to this error.

Perhaps @skywind3000 has some insight on this?

skywind3000 commented 6 years ago

Many plugins will populate quickfix window in a timer or in a background job such as ale, neomake and asyncrun. Background jobs and timers are designed for this.

Is there something about sandbox in quick-scope ?? Code running in sandbox is not allowed to execute many commands which will change buffer or execute shell commands. See:

:h sandbox

But asyncrun can't work without such things.

wookayin commented 5 years ago

Similar phenomenon happens with other async plugins, e.g. ALE

Error detected while processing function quick_scope#Aim[33]..<SNR>193_NeoVimCallback[29]..<SNR>188_HandleExit[49]..ale#engine#HandleLoclist[33]..ale#engine#SetResults[26]..ale#cu
rsor#EchoCursorWarning[20]..ale#cursor#TruncatedEcho:
line   15:
E523: Not allowed here
itainoam commented 3 years ago

To chime in, Also running into this issue with the following line in my vimrc:

autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' | checktime | endif
skywind3000 commented 3 years ago

Auto-commands takes too much time or invokes some blocking function (I/O, sleep/wait).

bradford-smith94 commented 2 years ago

The PR #81 that was just merged might also fix the E523 errors reported here. I don't know if that is the whole solution needed to make async plugins work with quick-scope but hopefully it is at least some progress.

I don't have a testing setup for this issue, but if someone interested in this could let me know whether or not the latest update helps I would be very appreciative.