t9md/vim-quickhl

set completeopt+=popup and complete work,Error happen.

tsuyoshicho opened this issue · 9 comments

setting

vim work with asyncomplete
set set completeopt+=popup

start edit and completion happen.

complete item select

message

 Error detected while processing function quickhl#manual#refresh[1]..quickhl#windo:
line    6:
E994: Not allowed in a popup window

function! quickhl#windo(func, obj) "{{{
let winnum = winnr()
let pwinnum = winnr('#')
" echo [pwinnum, winnum]
" echo PP(a:func)
" echo PP(a:obj)
noautocmd windo call call(a:func, [], a:obj)
if pwinnum !=# 0
execute pwinnum . "wincmd w"
endif
execute winnum . "wincmd w"
endfunction "}}}

windo work to popup buffer and error?

t9md commented

Thanks for reporting. It seems clearly quick-hl's bug.
It should be able to fix by detecting a popup window and ignore it.
If someone can fix it, I really appreciate it. I have not much time to work on this in the next 1.5 months.

t9md commented

I believe the above commit fix your issue.
I am not an active vim user now and I do not use an async complete popup, so I could not reproduce your issue in my setup.

My fix is technically read manual and theoretically applied what I believe I can fix.

Please give feedback to me when you tried.

t9md commented

I noticed my misunderstanding for window-ID, so the above code does not fix your issue.
Let me find proper way.

t9md commented

I believe this is it!
Please give feedback when you tried.

Thanks a� lot.
try it

I try it.

result:
Error happen.
message as same.

(note: Currently completion work vim-clang)

function quickhl#manual#refresh[1]..quickhl#windo の処理中にエラーが検出されました:
行   15:
E994: Not allowed in a popup window
function quickhl#manual#refresh[1]..quickhl#windo の処理中にエラーが検出されました:
行   19:
E994: Not allowed in a popup window
function quickhl#manual#refresh[1]..quickhl#windo の処理中にエラーが検出されました:
行   21:
E994: Not allowed in a popup window
function quickhl#manual#refresh[1]..quickhl#windo の処理中にエラーが検出されました:
行   15:
E994: Not allowed in a popup window
function quickhl#manual#refresh[1]..quickhl#windo の処理中にエラーが検出されました:
行   19:
E994: Not allowed in a popup window
function quickhl#manual#refresh[1]..quickhl#windo の処理中にエラーが検出されました:
行   21:
E994: Not allowed in a popup window

I re-try it.

error occur.


I think execute in normal(not popup) window, win_execute is usable?
see https://vim-jp.org/vimdoc-ja/eval.html#win_execute()

(error E994 is https://vim-jp.org/vimdoc-ja/eval.html#E994)

3rd try it.

It OK, do not happen error E994 and popup appear.