Open jmdevin opened 4 years ago
Looks like something similar happened here. May have been a change in Vim? They seem to have fixed it by writing their own popup creation function
We can fix this error by overriding the previewpopup
setting temporarily in the function to force the preview window to appear. I don't know why a previewpopup
setting was ever implemented. You can't run commands on the popups like you can with the preview window, which behaves pretty much like all Vim windows, so all it does is break things.
So far, I haven't found the newer popups to be useful at all. They look ugly, and you can't set custom syntax highlights in them. They just aren't anywhere near as good as the popups you'll see in something like VSCode. At least with the old preview windows you can import different syntax files and highlight code blocks for difference languages all at the same time, set keybinds, and all manner of useful things.
I'm still going to implement popup support at some point, but it won't ever be as good as the preview windows are.
Information
VIM version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun 16 2020 22:38:24) Included patches: 1-992
Operating System
Ubuntu 20.04
What went wrong
When the
'previewpopup'
option is non-empty, an ALE command which makes the popup window the "current" window (such as with:wincmd P
) will throwE441: There is no preview window
. This can be seen with:ALEDetail
.Relevant
:help
for'previewpopup'
:When not empty a popup window is used for commands that would open a preview window.
Reproducing the bug
:set previewpopup=height:10,width:60
:ALEDetail
The relevant function is this one:
It can be seen that the
wincmd P
on line 4 is causing the error, as popup windows cannot be entered directly for editing. Either this case should be checked for in advance, or this function should use a different method to modify the preview window, such aswin_execute()
,setwinvar()
,setbufvar()
, orpopup_settext()
.:ALEInfo