summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_extui/shared.lua
AgeCommit message (Collapse)AuthorFiles
2026-02-05refactor: rename _extui => _core.ui2 #37692luukvbaal1
Problem: _extui module name is confusing and should eventually end up in _core/. Solution: Move it there and name it ui2.
2026-02-03fix(ui2): wildmenu hidden behind dialog window #37684luukvbaal1
Problem: The wildmenu is hidden behind the dialog window with "list" in 'wildmode'. Global ('laststatus' set to 3) statusline is hidden behind the pager window. Solution: Check wildmenumode() to adjust the dialog position when necessary. Ensure pager is positioned above the global statusline with 'laststus' set to 3.
2026-01-26fix(ui): only internal messages are unsafe #37462luukvbaal1
Problem: Fast context for msg_show event inhibits vim.ui_attach from displaying a stream of messages from a single command. Solution: Remove fast context from msg_show events emitted as a result of explicit API/command calls. The fast context was originally introduced to prevent issues with internal messages.
2025-11-20fix(ui2): unset Search highlighting (#36633)Oleh Volynets1
Problem: Trying to match the search highlight groups to the Normal highlight for the window can fail when the message highlighting contains a fg/bg that the Normal highlight doesn't (like an error message in cmd will have ErrorMsg highlight instead of MsgArea - which is Normal in cmd.) Solution: Link the search highlight groups to an empty group in 'winhighlight' thus disabling them instead of overriding them with Normal/MsgArea/etc.
2025-11-19fix(ui2): hide search highlights in msg window #36626luukvbaal1
fix(ui2): hide search highlights in msg window. Problem: Search highlighting is shown in the msg (and dialog) window. Solution: Hide search highlighting in all but the pager window.
2025-11-08fix(ui): cmdline_show is not fired after clearing the screen (#36451)luukvbaal1
Problem: Resize events during startup may clear an active external cmdline, which is then not redrawn. UI2 VimResized autocommand does not work. UI2 message appearance may be altered by inherited window options. The message separator uses the wrong fillchar. Solution: Unset cmdline_was_last_redrawn when clearing the screen, such that cmdline_show is re-emitted. Ensure set_pos function is called without arguments. Ensure such options are unset. Use 'fillchars'->msgsep.
2025-10-27fix(ui2): emit FileType event after setting default pager options #36315yilisharcs1
Problem: Setting a filetype before configuring default options for ui2 buffers (pager, cmd, ...) prevents users from setting their own options. Solution: Call nvim_set_option_value after defaults are set. Closes #36314 Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2025-09-26fix(extui): setup buffers after activating `eventignorewin` (#35915)Tomasz N1
fix(extui): set options and buffer name after 'eventignorewin' Problem: Setting up extui buffers emits OptionSet and BufFilePost events. Solution: Set options and buffer name after 'eventignorewin'.
2025-09-06fix(types): nvim_get_win_config return type #35639Lewis Russell1
2025-08-21feat(extui): support paging in the dialog window (#35310)luukvbaal1
Problem: Unable to see e.g. `inputlist()` prompts that exceed the dialog window height. Multi-line prompts are not handled properly, and tracking is insufficient for messages in cmdline_block mode. Solution: Add vim.on_key handler while the dialog window is open that forwards paging keys to the window. Properly render multi-line prompts. Keep track of both the start and end of the current cmdline prompt. Append messages after the current prompt in cmdline_block mode.
2025-07-10test(ui/{cmdline,message}2_spec): reduce flakiness/runtime #34875luukvbaal1
Problem: Storing the configured 'cmdheight' value is scheduled and may happen after cmdline2_spec already entered block_mode. Excessive wait time for expected screen state due to delayed ruler after an error message. Solution: Only schedule storing the user configured 'cmdheight' if v:vim_did_enter is unset. Use regular message instead of error.
2025-07-09feat(extui): use winborder for msg window #34859Sebastian Lyng Johansen1
Problem: The message window is essentially a regular floating window but does not use 'winborder'. Still some "scratch" buffer options unset after it was removed from its window. Solution: Do not set the border when opening the window message. Forego passing `scratch = true` when opening a buffer, set the options manually when necessary. Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2025-06-27perf(extui): delay creating windows, buffers and parser (#34665)luukvbaal1
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.
2025-06-20fix(extui): set 'modifiable', 'noswapfile' for buffers (#34582)phanium1
Problem: UI buffers may be 'unmodifiable' and use a 'swapfile'. Solution: Set the 'modifiable' and 'noswapfile' options. Co-authored-by:phanium <91544758+phanen@users.noreply.github.com>
2025-06-13docs(extui): rename box->msg, more->pager, prompt->dialogLuuk van Baal1
Includes breaking changes to the `opts` layout. "box" doesn't really describe anything other than a floating window so was an unwanted synonym.
2025-06-13fix(extui): only append messages exceeding 'cmdheight' to "more"Luuk van Baal1
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.
2025-06-04fix(extui): copy window config to new tabpage (#34308)luukvbaal1
Problem: When opening a new tabpage, extui windows are initialized with their default config. Window visiblity/dimensions on other tabpages may get out of sync with their buffer content. Solution: Copy the config of the window to the new tabpage. No longer keep track of the various windows on each tabpage. Close windows on inactive tabpages instead (moving them could be more efficient but is currently not supported in the API).
2025-06-02fix(extui): properly setup "more" window for changed bufferLuuk van Baal1
Problem: Buffer setup after moving the message buffer to the "more" window after ff95d7ff is incomplete. Solution: Adjust and invoke tab_check_wins() to do the setup instead.
2025-06-02fix(extui): reposition "more" window after entering cmdwinLuuk van Baal1
Problem: Closing the "more" window for an entered cmdwin in ff95d7ff9 still requires special casing to properly handle "more" visibility. Solution: Reposition the "more" window instead; anchoring it to the cmdwin.
2025-06-01fix(extui): adjust "more" window routing (#34251)luukvbaal1
Problem: Message lines from multiple message events that end up spilling 'cmdheight' end up spread out over the cmdline and "more" window. Messages emitted as feedback to a typed :command (rather than its sole purpose like :echo/:=) are routed to the more window. The more window isn't closed when entering the cmdwin, and doesn't allow `vim.hl.on_yank()`. Solution: When first opening the "more" window for spilled messages, move the message buffer to the more window. Restrict routing of typed commands to echo kinds. Ignore all events but WinLeave and TextYankPost.
2025-05-26fix(extui): write each message chunk pattern separately (#34188)luukvbaal1
Problem: Bulking message lines to write in a single API call is complicated and still not correct w.r.t. overwriting highlights. Solution: Write each chunk pattern separately with it's highlight such that it will be spliced correctly for message chunks that contain a carriage return. Go with correctness over performance until this proves to be too inefficient. Also add an identifying name to the various extui buffers.
2025-05-24fix(extui): map wincmd instead of remapped key (#34151)phanium1
Problem: "q" cannot close window when `<c-w>` is mapped. Solution: Map q to `<Cmd>wincmd c<CR>`.
2025-05-09feat(extui): assign 'filetype' to extui windows (#33924)luukvbaal1
Problem: Unable to discern windows used by the extui interface to configure their local options. 'winblend' may be detrimental to legibility depending on the colorscheme and 'background'. Solution: Assign the "cmdline", "msgmore", "msgprompt" and "msgbox" 'filetype' to the respective windows. Don't set 'winblend' for the message "box" window.
2025-05-05fix(extui): drop "more" window that is no longer floating #33861luukvbaal1
Problem: Moving the "more" (or any extui)-window to a split with `wincmd L` does not invalidate it as a tracked window. Solution: Drop an extui window that is no longer floating.
2025-05-03fix(extui): search highlighting in extui "more" pager #33792luukvbaal1
Problem: No search highlighting in extui "more" pager window. Solution: Only use custom highlight namespace in cmdline window.
2025-05-02fix(extui): cmdline visibility, cmdheight cursor position (#33774)luukvbaal1
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'.
2025-05-02fix(extui): close message window with `q`Christian Clason1
Problem: Using `<c-c>` does not follow precedent (from `checkhealth` etc.) for closing "information windows". Solution: Use `q` for close mapping.
2025-05-02feat(ui): ext_cmdline/messages for the TUI #27855luukvbaal1
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.