"tabgrid" (multiple top-level windows) #7541
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This enables a external ui to draw multiple top-level windows from one nvim instance. Currently, follows the simple formula "one tabpage == one top-level window". Thus, tab commands as
tabnew
andtabnext
manage top-level windows whenext_multigrid
is active.Can be tested with the multigrid branch of python-gui neovim/python-gui#36. The pyhon-gui code is a big mess though because I changed my mind 5 times how to communicate grid/cursor focus to the UI. I might clean it up later. The rule I ended up with was to manage grids together with cursor position: the most recent
set_grid
tells the cilent the current grid, and together with the most recentset_cursor
forms the 3-tuple(grid_id, row, col)
which tells where drawing is done, and this state at the end of a"redraw"
array of updates should be seen as the current focus. Perhaps the event should be changed to a jointgrid_cursor_goto(grid_id, row, col)
to make this explicit. Alsoresize
andscroll
operates on the currently focused grid.Currently, keyboard input, mouse, and resizing with the mouse only works as expected for the (according to nvim) currently focused tabpage.
NB: expect a lot of redraw glitches and crashes. Before working much more on this I intend to get #6619 done, which already will introduce the generic multigrid abstraction, and "just" drawing buffer lines on a separate grid has lot less glitches than drawing exactly everything on multiple grids
Related: #2161 #5686 #2464