fix(extui): only append messages exceeding 'cmdheight' to "more"

Problem:  8defe1a declared the "more" window the most convenient place to
          route messages to if it is already open for msg.pos == 'cmd'.
          In usage, this doesn't appear to be the case. Appending messages
          as added in that commit is still useful, but should only be done
          for messages that spill 'cmdheight'.
Solution: Only append messages exceeding 'cmdheight' to the more window.
          To do this, instead of immediately writing to the more buffer,
          write to the cmd buffer and calculate its height. Then copy the
          text and its highlights to the more buffer.
This commit is contained in:
Luuk van Baal
2025-06-08 16:05:44 +02:00
committed by luukvbaal
parent 3e30323135
commit 76f76fb083
2 changed files with 40 additions and 36 deletions

View File

@@ -77,7 +77,7 @@ function M.tab_check_wins()
end
if setopt then
api.nvim_buf_set_name(M.bufs[type], 'vim._extui.' .. type)
api.nvim_buf_set_name(M.bufs[type], 'nvim.' .. type)
if type == 'more' then
-- Close more window with `q`, same as `checkhealth`
api.nvim_buf_set_keymap(M.bufs.more, 'n', 'q', '<Cmd>wincmd c<CR>', {})