[RFC] External ui #5686
[RFC] External ui #5686
Conversation
Very interesting! I will need to take a deeper look into this, for instance how does this integrate with window But at a quick glance, It looks like we could have a separate |
This patch's aim is to external everything that makes sense to be externalised. So probably win_external should be changed to ui_external. Re window ^W commands, it still let neovim to handle window layout management. But the external API will know the windows' sizes, positions, etc. So the most direct benefit is the line between vertical splits. |
There's still the minor question: do we want to allow UIs to opt-in to externalizing only certain pieces? If we put everything behind a single |
very cool ! I vote for granularity since it should be simple to provide (bitfield like) while adding a convenience: easier to provide a WIP UI, if some widget is buggy, the dev can disable it in favor of the native etc... |
I agree with @teto. The external popup menu does not have a very high priority for me and it'd be nice if it'd be an opt-in such that the "text"-based popup menus would continue to work. |
I do think it's better to just have a single I also think the previewWindow should be ui_external, it would useful to avoid redraw when completing. |
The floating window is useful for plugins like Crtl-P
I've added floating windows support. And preview-window can be an opt in. You can make it floating or still let Neovim to handle the window layout for it. But when you external window layout, you imply external cmdline, tabline as well, because the screen rendering happens at window level. So there's no "screen" for cmdline, tabline any more. |
https://www.youtube.com/watch?v=UgS-B12E0ps This screencast demonstrates the floating windows capability: The error information of the syntax is displayed in a floating preview-window and positioned at the cursor by the GUI. The FZF plugin is using the floating window that can be centered by the GUI. |
The floating window support seems very interesting, While I don't think it can help the Window Manager handle windows instead of nvim (#2161), I wonder if it could be used to provide UI-enhanced quickfix/location lists as displayed in https://a.fsdn.com/con/app/proj/texstudio/screenshots/errorHighlighting.png . I would love to have a button to toggle warning messages (I have a QFGrep mapping for that but sometimes buttons are a nice to have as well)? |
We could have a new wincmd command that can cycle through all floating windows. Something like wincmd fnext |
As you seem pretty fired up, I wonder if your UI display vim "menus" in any special way ? To reproduce your screencast, is using https://github.com/dzhou121/envim with this PR enough ? |
Keeping this rebased on master would be really helpful. @dzhou121 do you plan to write tests for this? |
I'll write tests once I know how should I proceed. Do I split the features into multiple PRs or still keep them in this one PR? |
@dzhou121 If you can split the features that would be extremely helpful, and will allow us to proceed much more quickly. |
For what is worth, I would vote to externalize command line first as there are some work on providing a sublime-like palette and the 2 combined together would be very cool. I had a look at the code and dropping the global variables |
Just submitted a new PR #6162 for cmdline_external |
PR #6168 for wildmenu_external |
PR #6170 for tabline_external |
There seems to be a typo here. Maybe tabline_external? |
@autozimu Thanks for the note. Have edited it. |
There is still externalizing echo and error messages. It will be needed before external window layout. |
Is anyone continuing to work on this? |
@chandlerc yes some developers are working on this as can be read in the linked PRs |
See also #8455 for per-window grids (which also will go a bit further than this, and let clients handle all wincmd:s if they want to) |
Thanks @dzhou121 for this substantial contribution. Large parts have been merged and benefited many GUI projects already: Other parts are continued to be developed in ongoing PRs We chose to implement per-window grids using a slightly different approach, as a 2018 GSOC project (#8455). However this PR was first to prototype the idea, and demonstrated that it was feasible with reasonable efforts. Closing this. For further general discussion of UI extensions, see #9421. |
This pull request is inspired by the external popupmenu and try to address the same approach for windows.
This patch will make neovim to treat each window individually and will output cmdline, tab, wildmenu to API without drawing them.
It will only have effect when win_external is set by API so tui is still working in the old way.
The achieved result is shown in this screencast:
https://youtu.be/rzclz1seo0g