diff options
| author | luukvbaal <luukvbaal@gmail.com> | 2025-06-27 15:54:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-27 15:54:32 +0200 |
| commit | bfe42c84de053abe125f7a61116bc8a97ec32cde (patch) | |
| tree | 6c02eccd6a5b3634b79e502ec23f7fad0aec2fe6 /runtime/lua/vim/_extui/messages.lua | |
| parent | 64753b5c37cf9d0d3aa2ced068d749cdab43e250 (diff) | |
perf(extui): delay creating windows, buffers and parser (#34665)
Problem: vim._extui unconditionally creates windows, buffers and the
Vimscript cmdline highlighter when it is first loaded.
Solution: Schedule first creation of the window so that first redraw
happens sooner (still need to create at least the cmdline
window asap as it can have a different highlight through
hl-MsgArea; thus further delaying until the first event that
needs a particular target seems redundant). Load the cmdline
highlighter on the first cmdline_show event.
Diffstat (limited to 'runtime/lua/vim/_extui/messages.lua')
| -rw-r--r-- | runtime/lua/vim/_extui/messages.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/lua/vim/_extui/messages.lua b/runtime/lua/vim/_extui/messages.lua index 5e9e1cde58..312a2a2a0e 100644 --- a/runtime/lua/vim/_extui/messages.lua +++ b/runtime/lua/vim/_extui/messages.lua @@ -310,7 +310,9 @@ function M.show_msg(tar, content, replace_last, append, pager) end api.nvim_win_set_cursor(ext.wins[tar], { 1, 0 }) - ext.cmd.highlighter.active[ext.bufs.cmd] = nil + if ext.cmd.highlighter then + ext.cmd.highlighter.active[ext.bufs.cmd] = nil + end -- Place [+x] indicator for lines that spill over 'cmdheight'. M.cmd.lines, M.cmd.msg_row = h.all, h.end_row local spill = M.cmd.lines > ext.cmdheight and ('[+%d]'):format(M.cmd.lines - ext.cmdheight) @@ -455,9 +457,12 @@ function M.set_pos(type) local function win_set_pos(win) local texth = type and api.nvim_win_text_height(win, {}) or 0 local height = type and math.min(texth.all, math.ceil(o.lines * 0.5)) + local top = { vim.opt.fcs:get().horiz or o.ambw == 'single' and '─' or '-', 'WinSeparator' } + local border = (type == 'pager' or type == 'dialog') and { '', top, '', '', '', '', '', '' } local config = { hide = false, relative = 'laststatus', + border = border or nil, height = height, row = win == ext.wins.msg and 0 or 1, col = 10000, |
