diff options
| author | luukvbaal <luukvbaal@gmail.com> | 2025-05-09 12:17:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-09 12:17:26 +0200 |
| commit | 7e787f6a4f16ddccfc3017e44f9cb9c9d1615dc3 (patch) | |
| tree | 69f9dd1f4b3f982a86bb5096be7f9424f0b7af7c /runtime/lua/vim/_extui.lua | |
| parent | 3121e02ae04e489fb11b7058f7b7d0da0901dafa (diff) | |
| download | rneovim-7e787f6a4f16ddccfc3017e44f9cb9c9d1615dc3.tar.gz rneovim-7e787f6a4f16ddccfc3017e44f9cb9c9d1615dc3.tar.bz2 rneovim-7e787f6a4f16ddccfc3017e44f9cb9c9d1615dc3.zip | |
fix(extui): route interactive messages to more-window (#33885)
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.
Diffstat (limited to 'runtime/lua/vim/_extui.lua')
| -rw-r--r-- | runtime/lua/vim/_extui.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/lua/vim/_extui.lua b/runtime/lua/vim/_extui.lua index 75adcfa7c5..8b3f67076e 100644 --- a/runtime/lua/vim/_extui.lua +++ b/runtime/lua/vim/_extui.lua @@ -82,10 +82,14 @@ function M.enable(opts) local function check_opt(name, value) if name == 'cmdheight' then -- 'cmdheight' set; (un)hide cmdline window and set its height. - ext.cmdheight = value - ext.cfg.msg.pos = ext.cmdheight == 0 and 'box' or ext.cfg.msg.pos - local cfg = { height = math.max(ext.cmdheight, 1), hide = ext.cmdheight == 0 } + local cfg = { height = math.max(value, 1), hide = value == 0 } api.nvim_win_set_config(ext.wins[ext.tab].cmd, cfg) + -- Change message position when 'cmdheight' was or becomes 0. + if value == 0 or ext.cmdheight == 0 then + ext.cfg.msg.pos = value == 0 and 'box' or ext.cmdheight == 0 and 'cmd' + ext.msg.prev_msg = '' + end + ext.cmdheight = value elseif name == 'termguicolors' then -- 'termguicolors' toggled; add or remove border and set 'winblend' for box windows. for _, tab in ipairs(api.nvim_list_tabpages()) do |