Problem: Extui shows a spill indicator to hint to the user to press "g<"
to show the output of the last command. The user may be
unaware of this mapping.
Solution: Route a hint message to the message "box" window.
Problem: Cannot enter "more" window while cmdwin is open since it is a
regular window and changing windows is disallowed.
Solution: Close cmdwin to enter the "more" window. Minor regression
w.r.t. the current message grid. Resolving that will require
somehow bypassing textlock for the "more" window.
Problem: Extui does not route messages emitted as a result of a typed
command to the "more" window.
Command message leading shell messages is missing a kind.
Messages not routed to 'cmdheight' area after it was 0.
Solution: Route messages that were emitted in the same event loop as an
entered command to the "more" window. Also append multiple
messages in an already open more-window.
Assign it the `shell_cmd` kind.
Change message position when 'cmdheight' changes from 0.
Problem: The "box" window width is calculated on the last line when
applying "last" virt_text. There may be longer lines
part of the same message.
Solution: Don't decrease box width if the calculated width is smaller.
Minor unrelated changes.
Co-authored-by: Eike <eike.rackwitz@mail.de>
Problem: More-window is left visible after leaving it. Cursor may be
hidden behind it and it is hard to re-enter afterwards.
Solution: Close the more-window when another window is entered.
Problem: The cmdline popupmenu is hidden behind extui windows.
'showmode' message is drawn over the cmdline.
Changing the 'cmdheight' to accommodate space for the text in
the cmdline may change the current cursor position.
Solution: Ensure kZIndexMessages < zindex < kZIndexCmdlinePopupMenu.
Clear the 'showmode' message when the cmdline level is negative.
Temporarily set 'splitkeep' = "screen" when changing the 'cmdheight'.
Problem: We have an unmaintained Vimscript parser and cmdline
highlighting mechanism, with which it is hard to leverage the
treesitter highlighter. Long messages result in a hit-enter-prompt.
Solution: Implement a vim.ui_attach() UI, that replaces the message
grid (orphaning some 3000+ LOC core C code). Introduce an experimental
vim._extui module, because removing the message grid at the same time is
too risky. The new UI leverages the bundled treesitter highlighter and
parser for Vimscript, as well as the matchparen plugin, to highlight the
cmdline. Messages are truncated in the cmdline area, or placed in a
floating message box in the bottom right corner. Special ("list_cmd")
messages and the message history are shown in a, "more prompt" (now a
fully interactive regular window). Various default UI elements ('showcmd',
'ruler') are also placed in the cmdline area, as virtual text.
`require('vim._extui').enable({})` enables the experimental UI.
`{ msg.pos = 'box' }` or `:set cmdheight=0` enables the message
box variant.
Followup:
- Come to a consensus for how best to represent messages (by default).
- Start removing message grid when this is deemed a successful replacement.
When that is finished, make this new UI the default and update a lot of tests.