summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_core/ui2
AgeCommit message (Collapse)AuthorFiles
2026-04-20fix(ui2): don't dismiss expanded messages for non-typed key #39247luukvbaal1
Problem: Invalid check for non-typed key to dismiss expanded cmdline. Unable to delay the timer that removes a message from the msg window. Solution: Check for empty string instead of nil to determine whether a key is typed. Restart the timer if it expires while the user is in the msg window. Allow entering the msg window with a mouse click.
2026-04-16fix(ui2): dialog paging is inconsistent #39128luukvbaal1
Problem: - Paging keys in the dialog window consume input when the user may not expect it. The dismissable title hint intended to mitigate that results in having to press Escape twice to abandon the prompt. - Mimicked "msgsep" float border is taking up unnecessary space when window takes up the entire screen. Solution: - Use (conventional, albeit less convenient) keys intended for scrolling to page the dialog window: <(Mousewheel/Page)Up/Down>, <Home/End>. - Only set the float top border when separation is actually necessary, i.e. window does not reach the first row.
2026-04-05fix(ui2): update spill indicator when appending to expanded cmdline #38715luukvbaal1
Problem: When messages are appended to an already expanded cmdline, the spilled lines indicator is not updated. Solution: Remove early return for updating virtual text while cmdline is expanded, guard updating "msg" virt_text at callsite instead.
2026-04-01fix(ui2): vim.on_key should return nil instead of false (#38668)phanium1
2026-03-31fix(ui2): flicker when entering pager from expanded cmdline #38639luukvbaal2
Problem: 'showcmd' causes flickering when pressing "g<" to enter the pager when the cmdline is expanded for messages. Initial keypress for an incomplete mapping is not giving 'showcmd' feedback while cmdline is expanded for messages (which is only dismissed upon the vim.on_key callback after 'timeoutlen'). Solution: Delay dismissing expanded cmdline when vim.on_key() callback receives "g". Place 'showcmd' "last" virtual text during expanded cmdline.
2026-03-31fix(cmdline): redraw cmdline after empty message (#38485)luukvbaal1
Problem: Cmdline is not redrawn after an empty message clears it. Remembered last drawn cursor position may be outdated but equal to the current cmdline content with UI2. Solution: Ensure cmdline is redrawn after an empty message clears it. Compare wanted cursor position with actual cursor position.
2026-03-30fix(ui2): correct buffer reference in msg:start_timer() (#38600)Ayush Goyal1
Problem: Mixing "buf" and "M.bufs.msg" in M.msg:start_timer(). Cannot run `require("vim._core.ui2").enable(nil)`. Solution: Replace "M.bufs.msg" with "buf". Allow `opts == nil`. Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2026-03-26fix(ui2): ENTER may focus pager in insert/terminal mode #38497phanium1
fix(ui2): prevent <CR> from focusing pager in insert/terminal mode Problem: <CR> in insert/terminal mode can focus pager unexpectedly. Solution: Don't enter the pager when <CR> is pressed during expanded cmdline in insert/terminal mode.
2026-03-26fix(ui2): no paging in dialog below expanded cmdline #38489luukvbaal1
Problem: When entering the cmdline below expanded messages, those messages are moved to the dialog window. The dialog window supports paging but that is unexpected in this situation where it just serves to keep (some of, exactly those that were visible before the cmdline was entered) the messages visible. Wrong highlight group for dialog "more" message. Solution: Don't create the `vim.on_key()` dialog pager callback after entering the cmdline below expanded messages. Use the MsgMore highlight group for the paging hint title.
2026-03-24fix(ui2): show messages in dialog window when entering expanded cmdline #38465luukvbaal2
Problem: - With expanded messages exceeding cfg.msg.cmd.height, entering the cmdline scrolls to the bottom and expands to the full "cmd" buffer text height. - Cursor in the pager is not always at the last message and at the bottom of the window when appending to the pager. - unreliable test: messages2_spec: "closed msg window timer removes empty lines". Solution: - Achieve separation of the cmdline and message text by moving messages to the dialog window when entering the cmdline below expanded messages. - Set cursor to start of the first message only when first entering the pager. Use `norm! zb` to position last message at the bottom of the window (which shouldn't crash anymore since 911337eb). - Increase cfg.msg.msg.timeout used in the test file.
2026-03-21feat(ui2): configure maximum window heights #38392luukvbaal1
Problem: - Window height is set dynamically to match the text height, making it difficult for the user to use a different height. - Cmdwin is closed to enter the pager but still taken into account for the pager position, and not restored when the pager is closed. - Dialog pager handler may unnecessarily consume <Esc>. Solution: - Add maximum height config fields for each of the UI2 windows, where a number smaller than one is a fraction of 'lines', absolute height otherwise (i.e. `cfg.msg.pager.height = 0.5`). - If the cmdwin will be closed to enter the pager, don't try to position the pager above it. Re-enter the cmdwin when the pager is closed. - Only add vim.on_key() handler for the dialog paging is actually possible.
2026-03-19fix(ui2): wrong condition used to detect active pagerLuuk van Baal1
Problem: Entering the pager is scheduled to avoid errors while in the cmdwin. Meanwhile the current window is used as a condition to detect an active pager. Solution: Keep track of when the user is in the pager (or entered the cmdwin while the pager was open).
2026-03-12fix(ui2): use pager to list consecutively typed commands #38272luukvbaal2
Problem: Mimicked block mode for cmdline entered while expanded does not work intuitively for repeated commands yielding messages exceeding the screen height. The expanded cmdline resizes and scrolls to bottom/top when appending a message and entering the cmdline. Also includes the entered command, as opposed to the UI1 behavior. Crash when scrolling to bottom of pager due to recursive uv_run after shell message callback executes `nvim_command()` with 'showcmd'. Solution: Still mimic block mode when entering the expanded cmdline, but when the entered command emits a message open the pager with the current message content in the expanded cmdline. Always route typed commands to the pager when it is open. Use `nvim_buf_set_cursor()` instead of `nvim_command()`.
2026-03-10Merge #37926 msg_show UI event indicates user-interactiveJustin M. Keyes1
2026-03-07fix(ui2): ensure expanded cmdline is closed after :<Esc> (#38187)luukvbaal2
Problem: Expanded cmdline is left open after entering the cmdline again without entering a command that emits another message (after 301c7065). Solution: Wait for msg_show to reinstate the vim.on_key() handler. If there was no message close the expanded cmdline.
2026-03-06fix(ui2): only highlight Ex command lines in the cmdline #38182luukvbaal2
Problem: Prompts and message text (in block mode) in the cmdline are parsed and highlighted as if it is Vimscript. Entering the cmdline while it is expanded can work more like it does with UI1, where the press enter prompt is replaced and previous messages stay on the message grid, while subsequent messages are placed below it. Solution: Highlight manually with string parser on lines starting with ':'. Spoof cmdline block mode when the cmdline is entered while it is expanded.
2026-03-06fix(ui2): immediately open target windows on new tabpage (#38170)luukvbaal1
Problem: Previous tests for this relied on other events opening the targets, which are not guaranteed to happen. Solution: Open target windows when entering a new tabpage.
2026-03-04feat(ui2): support routing "typed_cmd" trigger to targetLuuk van Baal1
Problem: Unable to immediately open a typed command in the pager. Solution: Support mapping msg_show "typed_cmd" trigger in cfg.msg.targets (e.g. `targets = { typed_cmd = 'pager' }`).
2026-02-28feat(ui2): configure targets per message kind #38091luukvbaal1
Problem: Unable to configure message targets based on message kind. Solution: Add cfg.msg.targets mapping message kinds to "cmd/msg/pager". Check the configured target when writing the message. cfg.msg = { target = 'cmd', targets = { progress = 'msg', list_cmd = 'pager' } } will for example use the 'msg' target for progress messages, immediately open the pager for 'list_cmd' and use the cmdline for all other message kinds.
2026-02-25fix(ui2): leftover empty lines in msg window #38059luukvbaal1
Problem: Timer removing a message from the msg buffer does not remove empty lines if window is closed (col([ui.wins.msg]) fails). Solution: Use nvim_buf_get_text() to check if line is empty.
2026-02-24fix(ui2): multiline/color replaced message, expanded cmdline, error messages ↵luukvbaal1
#38044 Problem: - Unintentionally inserting lines for a replaced multiline message that also has multiple highlights. - Scheduled check to see if the expanded cmdline window was entered makes it difficult to keep track of what happens when the key pressed to dismiss it results in a message. - Reading the first line of an error message should be enough notice for something going wrong. - "search_cmd" messages should not be shown with 0 'cmdheight'. - Unable to configure dynamically changed pager height. - Enabling UI2 doesn't make sense with no UIs attached. Solution: - Only insert a line for the first chunk after a newline. - Use getmousepos() to check if the expanded cmdline was clicked to enter the pager. entering the pager to serve as a configuration interface. - Don't expand the cmdline for error messages; user can press g<. - Don't show "search_cmd" messages with 'cmdheight' set to 0. - Change 'eventignorewin' to ensure WinEnter is fired when - Have enable() return early when no UIs are attached.
2026-02-17fix(ui2): don't change configured message target implicitly #37924luukvbaal1
Problem: Implicitly setting message target when 'cmdheight' changes. Solution: Just use the user configured target. Support "cmd" target with 'cmdheight' set to 0.
2026-02-17feat(ui2): show active paging keys in dialog float title #37919luukvbaal1
Problem: Paging keys being consumed without obvious indicator in the dialog window can be surprising. Solution: Display a hint with paging keys in the dialog window title when paging is active. Recognize <Esc> as mapping to stop paging.
2026-02-16fix(ui2): only set dialog on_key callback once #37905luukvbaal2
Problem: vim.on_key() called for each message while cmdline is open. Cursor is on a seemingly random column when pager is entered. Entering the pager while the cmdline is expanded can be more convenient than pressing "g<". Pager window is unnecessarily clamped to half the shell height. Setting 'laststatus' while pager is open does not adjust its dimensions. Solution: Only call vim.on_key() once when dialog window is opened. Ensure cursor is at the start of the first message when entering the pager. Enter the pager window when "<CR>" is pressed while the cmdline is expanded. Don't clamp the pager window height. Set message windows dimensions when 'laststatus' changes.
2026-02-12fix(ui2): incomplete :echon message in g< pager #37819phanium1
Problem: `:echo 1 | echon 2<cr>g<` shows "2", but should be "12". Solution: Don't clear temp msg (g<) if we are appending.
2026-02-05fix(ui2): always route to dialog when cmdline is open #37730luukvbaal2
Problem: Messages emitted while cmdline is open are not shown with cmdline message target. Solution: Route to dialog window when cmdline is open.
2026-02-05refactor: rename _extui => _core.ui2 #37692luukvbaal2
Problem: _extui module name is confusing and should eventually end up in _core/. Solution: Move it there and name it ui2.