ClangComplete getting E565 now

329 views
Skip to first unread message

mckel...@gmail.com

unread,
Feb 3, 2021, 10:50:20 PM2/3/21
to vim_dev
Hi,

Very recently I am getting errors -

Error detected while processing function ClangComplete[2]..<SNR>31_ClangComplete[62]..<SNR>31_HasPreviewAbove:
line    4:
E565: Not allowed to change text or change window

When using clang plugin.
This all worked ok before and I know its ok in 8.2.2410.
I have not bisected the commit since then that started this, I will do that tomorrow.
Is this now expected and the plugin needs to change ?

thx as always for everything vim,
-m

mckel...@gmail.com

unread,
Feb 3, 2021, 11:38:45 PM2/3/21
to vim_dev
Hi,

Just more info, a few changes to plugin/clang.vim and it seems to work ok now -

--- a/plugin/clang.vim
+++ b/plugin/clang.vim
@@ -583,11 +583,11 @@ func! s:HasPreviewAbove()
   let l:cwin = winnr()
   let l:has = 0
   " goto above
-  wincmd k
+  "wincmd k
   if &completeopt =~ 'preview' && &previewwindow
     let l:has = 1
   endif
-  exe l:cwin . 'wincmd w'
+  "exe l:cwin . 'wincmd w'
   return l:has
 endf
 "}}}
@@ -1405,7 +1405,7 @@ func! s:ClangComplete(findstart, base)
     " close preview window if empty or has no preview window above, may above
     " other windows...
     if empty(b:clang_cache['completions']) || !s:HasPreviewAbove()
-      pclose
+      "pclose
     endif
     " call to show diagnostics

But not sure if this is the only way forward ?

thx,
-m

Christian Brabandt

unread,
Feb 4, 2021, 3:14:48 AM2/4/21
to vim_dev
Patch 8.2.2427 and 8.2.2426 disallow changing windows in the
completefunc. The only way forward is to contact the plugin author to
adjust the plugin and not change windows.

BTW: When asking such questions, please make sure to mention the Vim
version that errors out.

Best,
Christian
--
Verantwortlich ist man nicht nur für das, was man tut, sondern auch
für das, was man unterläßt.
-- Laotse (chin. Philosoph, 4-3 Jhd. v.Chr.)

mckel...@gmail.com

unread,
Feb 4, 2021, 8:21:32 AM2/4/21
to vim_dev
Hi,

ok, thank you.
I submitted a PR to the plugin repo.

take care,
-m
Reply all
Reply to author
Forward
0 new messages