Open liskin opened 3 years ago
I added a sentence to the documentation now saying to only turn the popup menu support on for GUI versions of Vim. The default setting is based on has('gui_running')
, so it should only run in GUI Vim by default.
Oh. :-/
If I ever figure out how to do the menu setup synchronously and add the nested menu workaround, will you be interested in a PR or shall I carry this in my local fork?
If you can put together something reasonable that works, feel free to create a pull request. Putting menu items in the menu synchronously might not work because the available code actions are sent asynchronously from the language servers, but "Rename" could work because we can assume we can just rename any word.
Well it just occurred to me that the nested menu workaround might actually solve both issues: by the time the user selects the submenu, it'll likely already have been populated from the async LSP reply. I'll try that once I get back to hacking on vim stuff. Thanks for your reply, I probably wouldn't get the idea otherwise. :-)
I'll leave the issue open and you can tag it with your pull request.
Information
VIM version
Operating System: Debian testing
What went wrong
The right-click popup menu in console (not gui) vim glitches because of two bugs/limitations in upstream vim:
https://user-images.githubusercontent.com/300342/103799763-d1596c80-504b-11eb-81f2-307e44fd6f51.mp4
The first issue is that the second entry is not
Refactor...
but(None)
when opened for the first time and some old memory contents for the second time. The illegal memory access was fixed in https://github.com/vim/vim/commit/38455a921395a56690790c8c1d28c1c43ca04c8a, but the menu still isn't supposed to be updated asynchronously. Bram says:ale doesn't change the number of entries in the PopUp menu itself, so with https://github.com/vim/vim/commit/38455a921395a56690790c8c1d28c1c43ca04c8a it should more or less work, but it'd still be better to do this synchronously, I think, just to be safe and to fix this in older versions of vim.
The second issue is better illustrated when running in vim with https://github.com/vim/vim/issues/7537 fixed:
https://user-images.githubusercontent.com/300342/103801429-036bce00-504e-11eb-9ec1-3d562c0c724f.mp4
Now the
Refactor...
entry is visible but it doesn't act as a submenu, so no refactors can be done in console vim. There is no reply in https://github.com/vim/vim/issues/7539 yet, but I did found a workaround:Both menus are visible in gvim, so this workaround must be only used in console vim.
Reproducing the bug
Enable right-click popups:
Run vim with ale where some LSP is available & enabled.
Right click somewhere.
Popup appears, but the second entry is either corrupt (without https://github.com/vim/vim/issues/7537 fix) or not functional (with the fix but with https://github.com/vim/vim/issues/7539 still present).
:ALEInfo