summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_extui/cmdline.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-04fix(ui2): don't adjust dialog pos for pum wildmenu (#37695)Sean Dewar1
Problem: Dialog position unnecessarily adjusted for pum wildmenu. Solution: Apply no offset if the pum is visible.
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.
2025-10-22fix(ui2): start treesitter after deleting cmdline buffer (#36274)luukvbaal1
Problem: Treesitter is not started in new cmdline buffer after deletion. Solution: Start treesitter when highlighter buffer no longer matches.
2025-08-27fix(extui): error on :call input('') (#35515)phanium1
Problem: Error on empty string prompt. Solution: (prompt .. '\n'):gmatch('(.-)\n').
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-06-27feat(extui): don't enter pager for routed message #34679luukvbaal1
Problem: Messages routed to the pager to be shown in full, enter the pager automatically, yielding another "press-q-prompt". Solution: Only enter the pager when requested explicitly. Otherwise, close the pager on the next typed mapping, unless that mapping entered the pager.
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-26feat(ui): emit "msg_clear" event after clearing the screen (#34035)luukvbaal1
Problem: ext_messages cannot tell when the screen was cleared, which is needed to clear visible messages. An empty message is also never emitted, but clears messages from the message grid. Solution: Repurpose the "msg_clear" event to be emitted when the screen was cleared. Emit an empty message with the `empty` kind to hint to a UI to clear the cmdline area.
2025-06-15fix(extui): clear cmdline buffer for first message (#34490)luukvbaal1
Problem: Cmdline buffer is not cleared for a new message (since c973c7ae), resulting in an incorrect spill indicator. When the cmdline buffer is cleared, "msg_row" is not invalidated, resulting in an error. The extui module is untested. Return value of `vim.ui_attach()->callback` is undocumented. Solution: Clear the cmdline buffer for the first message in an event loop iteration. Ensure msg_row passed as end_row does not exceed buffer length. Add `messages_spec2.lua` to test the extui module, keeping in mind that test coverage will greatly increase if this UI is made the default. As such, only tests for specific extui functionality unlikely to be covered by tests leveraging the current message grid. Document the return value of `vim.ui_attach()->callback`, it seems to make sense, and is also used to suppress remote UI events in `messages_spec2.lua`.
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-09fix: `fn.exists()` typos (#34390)phanium1
Problem: `exists()` checks should test for being equal to 1 rather than truthy, and extui check can be more restrictive. Solution: Adjust `exists()` guards to equal 1 and use `matchparen#CursorMoved`.
2025-06-06fix(extui): use visible to determine active "more" (#34327)luukvbaal1
Problem: Current window is checked to determine whether "more" window is open. Making it the current window is scheduled in case the cmdwin is open so this can be too late. "cmdline_hide" may be emitted when the topline is temporarily invalid (after incsearch->restore_viewstate()). Solution: Use the window visibility to determine an active "more" window instead. Don't nvim__redraw->flush the "cmdline_hide" event (a normal will already happen).
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-05-27fix(extui): incorrect cmdline cursor position (#34201)luukvbaal1
Problem: Calculated cmdline cursor position can be smaller than 0. Prompt part of the cmdline is translated, while it should support "\t" characters. Solution: Remove prompt part from the stored "cmdbuff" and get rid of dubious +/-1 from cmdline cursor calculation.
2025-05-24fix(extui): using tracked message column in cleared buffer (#34154)luukvbaal1
Problem: Using tracked message column as column in cleared buffer. Solution: Ensure column does not exceed current line length. Further work to ensure carriage return and cmdline block mode work properly.
2025-05-17fix(extui): translate <Tab> in cmdline text (#34055)luukvbaal1
Problem: <Tab> is not translated on the cmdline, and exposes a wrong assumption in search messages that may contain multiple chunks. Solution: Translate unprintable characters in the cmdline content. Extract the 'search_count' from the last chunk and route 'search_cmd' to cmdline to handle multiple chunks.
2025-05-09fix(extui): route interactive messages to more-window (#33885)luukvbaal1
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.
2025-05-04fix(extui): message may overwrite active cmdline #33846luukvbaal1
Problem: Active cmdline may be overwritten by a message. Solution: Check if cmdline is active before writing message.
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-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.