aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/cmdline2_spec.lua
Commit message (Collapse)AuthorAge
* vim-patch:9.2.1031: 'wildmode' list:full does not show 'wildmenu'zeertzjq2026-09-02
| | | | | | | | | | | | | | | | | Problem: With 'wildmode' set to list:full the matches are listed but the wildmenu is not shown, although it is "full" that starts wildmenu mode (zeertzjq). Solution: List the matches and show the menu, as the two behaviors in the same phase ask for. The menu is left to the phases that ask for it, so that "list" on its own still only lists (Hirohito Higashi). fixes: vim/vim#21196 closes: vim/vim#21205 https://github.com/vim/vim/commit/fa1ddffcce24f22d61608c0086e55adadd1d2c11 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* test: fix wrong order of args to eq(), neq() #41499zeertzjq2026-08-26
|
* fix(ui2): retain substitute confirmation highlight with nohlsearch #41067debaditya2026-08-03
| | | | | | | Problem: ui2 clears the substitute confirmation match when it updates its prompt buffer with hlsearch disabled. Solution: Only invalidate the match highlight when the current buffer changes.
* fix(ui2): `:$q` should not target hidden windows #40992Rob Pilling2026-08-02
| | | | | | | | | | | | | | | | | | | | | | | Similar to #36123, the ui2 windows confuse `:$q`, which doesn't close the last window on the tab, but targets a hidden ui2 window. The problem seems to be a combination of using `FOR_ALL_WINDOWS_IN_TAB()`, which includes hidden windows, and then counting the windows without factoring in `win_has_winnr()`. There are examples of using `win_has_winnr()`, such as: - [`eval/buffer.c`'s `buf_win_common()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/eval/buffer.c#L474-L475) - [`eval/window.c`'s `f_getwininfo()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/eval/window.c#L130-L135) - [`window.c`'s `win_get_tabwin()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/window.c#L7860-L7869) But possibly problematic ones: - `ex_docmd.c`'s: - [`invalid_range()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/ex_docmd.c#L3891-L3893) - ^ should this include hidden windows? Can a user address them by number? `win_has_winnr()` suggests not - [`ex_close()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/ex_docmd.c#L5233-L5244) - [`ex_hide()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/ex_docmd.c#L5478-L5484) - `eval/window.c`'s: - [`f_winrestcmd()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/eval/window.c#L797-L808) - [`find_win_by_nr()`](https://github.com/neovim/neovim/blob/4a5062cda69fa6cb59b7dc0c488dfb05accf99de/src/nvim/eval/window.c#L172-L180)
* fix(ui2): clear empty cmdline after backspace #41043Nathan Zeng2026-07-29
| | | | | | | | Problem: Cmdline area shows stale ":" after backspacing out of the command line. Solution: Clear the command line for empty commands. Note that `:<CR>` will now clear the command line too.
* test(harness): migrate away from magic globalsJustin M. Keyes2026-07-21
| | | | | | | | | | | | | | | | | | | | | Problem: The magic globals `it`, `describe`, etc., are more trouble than they are worth. - Hooking into `after_each` requires `getfenv()` hacks. - They confuse luals/emmylua, because the top-level `.luarc.json` isn't merged with `test/.luarc.json` (apparently a luals limitation?) - They totally defeat discoverability because the user just has to "know" about the various magic symbols. So they harm DX, which means they serve no purpose at all. Solution: - Expose the test API from `testutil`, so tests can call `t.it()`, `t.describe()`, etc., in the conventional way. - Drop `getfenv()` hacks. - Drop the `setfenv()` injection in `load_chunk`. - Drop `test/_meta.lua`.
* fix(ui2): message before empty prompt not shownLuuk van Baal2026-06-22
| | | | | Problem: Message before empty input() is not visible. Solution: Route to dialog window with active prompt (hl_id >= 0).
* fix(ui2): unable to route by message ID #39734luukvbaal2026-05-11
| | | | | | | | | | | | | | | | | | | | | Problem: - "bufwrite" message identifier is encoded in the message ID of a "progress" kind message (since ff68fd6b); UI2 does not allow routing by message ID. - No documented way to set a default message target for all but a few kinds (without copying all of |ui-messages| kinds to cfg.msg.targets). - A user adding a message route for the documented empty "" kind can result in unexpected behavior. - Showing duplicate message (x) indicator in msg and cmd targets simultaneously is unsupported. - Manually triggering CursorMoved autocommand to add matchparen highlighting in the cmdline. Solution: - Match cfg.msg.targets keys as Lua pattern to a message ID. - Recognize "default" as key in cfg.msg.targets, drop the undocumented cfg.msg.target field. - Don't try to get configured target for "" message kind/trigger. - Maintain msg indicator virtual text for the cmd and msg target. - Add matchparen highlighting by directly calling the Lua module (possible since b813c7e0).
* fix(cmdline): avoid 'incsearch' recursion after redraw #39303luukvbaal2026-04-22
| | | | | | | Problem: A vim.ui_attach() callback that redraws to show a 'verbose' regex message during 'incsearch' results in recusive redrawing. Solution: Check that curwin was redrawn instead of just any window when determining if 'incsearch' highlighting was cleared.
* fix(cmdline): 'inccommand' preview after setcmdline() #38795luukvbaal2026-04-06
| | | | | | | Problem: 'inccommand' preview is not executed after setcmdline(), and as a result cmdline_show event is emitted when redrawing is not allowed (5b6477be). Solution: Call command_line_changed() when ccline.cmdbuff_replaced is set (by setcmdline()).
* fix(cmdline): redraw cmdline after empty message (#38485)luukvbaal2026-03-31
| | | | | | | 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.
* fix(ui2): only highlight Ex command lines in the cmdline #38182luukvbaal2026-03-06
| | | | | | | | | | | 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.
* fix(ui2): multiline/color replaced message, expanded cmdline, error messages ↵luukvbaal2026-02-24
| | | | | | | | | | | | | | | | | | | | | | | #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.
* fix(messages): unwanted ext_messages newlines for confirm() #38045luukvbaal2026-02-24
| | | | | Problem: Newlines emitted with ext_messages intended to position the message/prompt on the message grid. Solution: Don't emit these newlines with ext_messages, followup to 4260f73e.
* fix(ui2): always route to dialog when cmdline is open #37730luukvbaal2026-02-05
| | | | | Problem: Messages emitted while cmdline is open are not shown with cmdline message target. Solution: Route to dialog window when cmdline is open.
* refactor: rename _extui => _core.ui2 #37692luukvbaal2026-02-05
| | | | | | | Problem: _extui module name is confusing and should eventually end up in _core/. Solution: Move it there and name it ui2.
* fix(ui2): don't adjust dialog pos for pum wildmenu (#37695)Sean Dewar2026-02-04
| | | | Problem: Dialog position unnecessarily adjusted for pum wildmenu. Solution: Apply no offset if the pum is visible.
* fix(ui2): wildmenu hidden behind dialog window #37684luukvbaal2026-02-03
| | | | | | | 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.
* fix(ui): no empty message for substitution match with ext_messages #37600luukvbaal2026-01-29
| | | | Problem: Empty message is emitted when a match is found. Solution: Don't emit it with ext_messages enabled.
* fix(ui): only internal messages are unsafe #37462luukvbaal2026-01-26
| | | | | | | | 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.
* fix(ui): exclude hidden windows from tabline window count #36779benarcher26912025-12-01
| | | | | | | | | | | | | | | | | Problem: When `vim._extui` is enabled, the default tabline shows an incorrect window count (e.g., "2" when only 1 window is visible). This happens because the extui pager window has `focusable=true` (needed for user interaction) but `hide=true` (not visible by default). Solution: Modify the window counting logic in `statusline.c` and `ex_docmd.c:ex_tabs()` to also exclude hidden windows (`wp->w_config.hide`), not just non-focusable windows. Also updates test expectations in `cmdline2_spec.lua` which previously expected the incorrect window count "2" when extui was enabled. The test now correctly expects no window count indicator when only 1 visible window exists. Fixes #36759
* fix(ui): cmdline_show is not fired after clearing the screen (#36451)luukvbaal2025-11-08
| | | | | | | | | | | | 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.
* fix(ui): ignore textlock for vim.ui_attach() callbacks #36278luukvbaal2025-10-24
| | | | Problem: vim.ui_attach() callbacks may run into E565 textlock errors. Solution: Changing text in UI buffers must be safe; assume it is.
* fix(ui2): start treesitter after deleting cmdline buffer (#36274)luukvbaal2025-10-22
| | | | Problem: Treesitter is not started in new cmdline buffer after deletion. Solution: Start treesitter when highlighter buffer no longer matches.
* fix(extui): error on :call input('') (#35515)phanium2025-08-27
| | | | Problem: Error on empty string prompt. Solution: (prompt .. '\n'):gmatch('(.-)\n').
* feat(extui): don't enter pager for routed message #34679luukvbaal2025-06-27
| | | | | | | | 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.
* fix(cmdline): validate 'incsearch' cursor for "cmdline_show" redraw (#34630)luukvbaal2025-06-24
| | | | | | Problem: "cmdline_show" event may be emitted with an invalid cursor position, causing a redraw that will clear the match highlight. Solution: Mark the cursor position as valid so that a "cmdline_show" callback that updates the screen does not clear the match highlight.
* fix(autocmd): 'cmdheight' OptionSet with valid window grids (#34619)luukvbaal2025-06-24
Problem: OptionSet autocmd emitted with invalid grids after entering tabpage with different 'cmdheight'. Solution: First call `tabpage_check_windows()` before changing 'cmdheight'. Add a test that exercises the `vim._extui` cmdline.