···32323333local prompt_hl_id = vim.api.nvim_get_hl_id_by_name("ArtioPrompt")
34343535---- Set the 'cmdheight' and cmdline window height. Reposition message windows.
3636----
3737----@param win integer Cmdline window in the current tabpage.
3838----@param hide boolean Whether to hide or show the window.
3939----@param height integer (Text)height of the cmdline window.
4040-local function win_config(win, hide, height)
4141- if ui2.cmdheight == 0 and vim.api.nvim_win_get_config(win).hide ~= hide then
4242- vim.api.nvim_win_set_config(win, { hide = hide, height = not hide and height or nil })
4343- elseif vim.api.nvim_win_get_height(win) ~= height then
4444- vim.api.nvim_win_set_height(win, height)
4545- end
4646- if vim.o.cmdheight ~= height then
4747- -- Avoid moving the cursor with 'splitkeep' = "screen", and altering the user
4848- -- configured value with noautocmd.
4949- vim._with({ noautocmd = true, o = { splitkeep = "screen" } }, function()
5050- vim.o.cmdheight = height
5151- end)
5252- ui2.msg.set_pos()
5353- end
5454-end
5555-5635---@class artio.View
5736---@field picker artio.Picker
5837---@field closed boolean
···169148 self:hlselect()
170149end
171150151151+--- Set the 'cmdheight' and cmdline window height. Reposition message windows.
152152+---
153153+---@param win integer Cmdline window in the current tabpage.
154154+---@param hide boolean Whether to hide or show the window.
155155+---@param height integer (Text)height of the cmdline window.
156156+function View:win_config(win, hide, height)
157157+ if ui2.cmdheight == 0 and vim.api.nvim_win_get_config(win).hide ~= hide then
158158+ vim.api.nvim_win_set_config(win, { hide = hide, height = not hide and height or nil })
159159+ elseif vim.api.nvim_win_get_height(win) ~= height then
160160+ vim.api.nvim_win_set_height(win, height)
161161+ end
162162+ if vim.o.cmdheight ~= height then
163163+ -- Avoid moving the cursor with 'splitkeep' = "screen", and altering the user
164164+ -- configured value with noautocmd.
165165+ vim._with({ noautocmd = true, o = { splitkeep = "screen" } }, function()
166166+ vim.o.cmdheight = height
167167+ end)
168168+ ui2.msg.set_pos()
169169+ end
170170+end
171171+172172---@param predicted? integer The predicted height of the cmdline window
173173function View:updatewinheight(predicted)
174174 local height = math.max(1, predicted or vim.api.nvim_win_text_height(ui2.wins.cmd, {}).all)
175175 height = math.min(height, self.win.height)
176176- win_config(ui2.wins.cmd, false, height)
176176+ self:win_config(ui2.wins.cmd, false, height)
177177end
178178179179function View:saveview()
···391391 clear(cmdline.prompt)
392392393393 cmdline.prompt, cmdline.level = false, 0
394394- win_config(ui2.wins.cmd, true, ui2.cmdheight)
394394+ self:win_config(ui2.wins.cmd, true, ui2.cmdheight)
395395end
396396397397function View:trigger_show()