summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/ui/float_spec.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-16fix(float): don't unload 'hidden' float buffer with :close! (#39096)luukvbaal1
Problem: When closing floating windows to close a tabpage, if the current buffer will unload, buffers contained in those floating windows will too (unexpectedly). Solution: Don't pass along "free_buf" argument; check 'bufhidden' for the buffer in the to be closed float.
2026-04-14feat(api): use zindex to determine dimmed cursor shape #39054luukvbaal1
Problem: The cursor shape is changed to indicate when it is behind an unfocused floating window (since a2b92a5e). This behavior cannot be controlled by a floating window that doesn't want to dim the cursor. Solution: Assign a zindex-offset of 50 to the zindex of the current window. To not dim the cursor when creating a floating window on top of the current window one can assign the zindex accordingly.
2026-03-16fix(api): use standard error messagesJustin M. Keyes1
2026-03-14fix(api): improve external window validationSean Dewar1
Problem: "win" is allowed in external window configs in some cases. External window converted to normal float can't move tabpages in one nvim_win_set_config call. External window can't be turned into a normal split. Solution: disallow setting "win" for external windows. Allow external window to move tabpages, which turns it non-external. Allow external window to be turned into a (non-external) split. parse_win_config has more validation issues from not considering the window's existing config enough (not from this PR). For example, zindex can be set for an existing split if "split"/"vertical" isn't given, despite intending for that to be an error. Plus the logic is confusing. It could do with a refactor at some point...
2026-03-14feat(api): nvim_win_set_config can move split to other tp as floatwinSean Dewar1
Problem: not possible for nvim_win_set_config to convert a split to a floatwin, then move it to another tabpage in one call. Solution: allow it.
2026-03-14fix(winfloat): last_status when changing split to floatwinSean Dewar1
Problem: converting a split to a floatwin may not remove the last statusline when needed. (e.g: 'ls' is 1) Solution: call last_status/win_comp_pos in win_new_float, after win_remove. Also fix float_pos formatting for screen snapshots so it doesn't give a nil error for external windows. Not an issue from this PR.
2026-03-14fix(api): relax config validation for "win"Sean Dewar1
Problem: only possible to move floats between tabpages if relative=win, which has the restrictive effect of also anchoring it to the target window. Solution: allow "win" without "relative" or "split"/"vertical". Only assume missing "win" is 0 if relative=win is given to maintain that behaviour. (or when configuring a new window) Also add an error when attempting to change a split into a float that's in another tabpage, as this isn't actually supported yet. (until the next commit) Maybe this could do with some bikeshedding. Unclear if "win" should require "relative" to be given, like with "row"/"col"; this can be annoying though as specifying "relative" requires other fields to be given too.
2026-03-14fix(api): don't config split as floatwin relative to itselfSean Dewar1
Problem: possible to configure a split as a floatwin with relative=win that is relative to itself. Solution: fix the check. Not caused by this PR; just something I noticed when about to fix the validation logic.
2026-03-14fix(api): win_config_float_tp grid removal, redrawSean Dewar1
Problem: when nvim_win_set_config moves a floatwin between tabpages, its grid may remain if temporarily inside another tabpage. Also, things like tablines aren't redrawn. Solution: always remove its grid. Set must_redraw so things are redrawn even if w_redr_type was already set for the old tabpage. I don't think it's necessary to do anything extra here when removing the grid: - win_ui_flush calls ui_call_win_hide anyway, and calling it manually ends up sending two win_hide events. - ui_comp_remove_grid safely does nothing if the grid doesn't exist. - w_pos_changed is set by win_config_float later, if that's needed. I think the pending_comp_index_update set by ui_comp_remove_grid is enough anyway, at least for making sure win_ui_flush sends win_hide. Added test fails with the prior approach of checking `parent_tp != curtab`, but also `win_tp == curtab`. (which is a better, but still flawed alternative) The added redrawing here also supersedes setting w_hl_needs_update, and also redraws stuff like the tabline to pass the new test.
2026-03-11fix(compositor): clear old position with last known dimensions #38229luukvbaal1
Problem: When reconfiguring a float reallocates the grid before the old area is cleared, artifacts are left on the screen. Solution: Use the last known compositor dimensions of a grid when clearing the area covered by the old position. Co-authored-by: glepnir <glephunter@gmail.com>
2026-03-09fix(api): don't re-apply minimal style if unchanged #38152Sean Dewar1
Problem: nvim_win_set_config with style=minimal re-applies option values even if the new style is unchanged from the old. This may be undesirable after #38122. Solution: don't bother in this case. See https://github.com/neovim/neovim/pull/38122#issuecomment-3996994189. A reversal of https://github.com/neovim/neovim/pull/22865#discussion_r1161598973 so its associated test has been updated.
2026-03-08fix(api): merge split window config only on successSean Dewar1
Problem: nvim_win_set_config may merge configs despite failing to configure a split, and without applying necessary side-effects (like setting style=minimal options). Plus, autocommands may apply a different config after the merge, causing side-effects to apply for an outdated config. Solution: merge configs last, only on success. Include fields only relevant to splits. Properly set _cmdline_offset for splits. Maybe better to disallow _cmdline_offset for splits instead, as the pum is relative to cmdline_row anyway? (I didn't want to change behaviour too much) Also use expect_unchanged in an unrelated test to quash a warning.
2026-03-03fix(api): return "style" in nvim_win_get_config() #38122Sean Dewar1
Problem: nvim_win_get_config() does not return a window's "style". Solution: always include it, and document `style=""`. Always included so it can be used reciprocally with nvim_open_win() or nvim_win_set_config(). (otherwise the config of a window with kWinStyleUnused will not unset the kWinStyleMinimal style of another window if passed to nvim_win_set_config, for example)
2026-03-03fix(window): style=minimal window loses local options when switching buffers ↵glepnir1
#38138 Problem: 5943a81 skips saving window options in `buflist_altfpos` for style=minimal windows, which also prevents the window from restoring its own options when switching buffers. Solution: revert the change. In `get_winopts`, don't restore options from the `WinInfo` of style=minimal windows when reusing values for a different window. In `win_free`, clear `wi_optset` for minimal windows.
2026-02-28fix(float): style=minimal leaks into normal windows #25185glepnir1
Problem: closing a minimal float saves its style-imposed options into buffer's wininfo, which get picked up by normal windows on :bnext. Solution: don't save window options to wininfo for style=minimal windows.
2026-02-16fix(float): clamp floating window above cmdline #37899luukvbaal1
Problem: A float whose zindex is below the cmdline can be enlarged and end up behind the cmdline. Solution: Clamp height of such windows to not extend beyond 'cmdheight'.
2026-02-04test(float): cursor unobscured by hidden float and in cmdlineSean Dewar1
2026-02-04feat(ui): show "empty" cursor behind unfocused floatwin #37624glepnir1
Problem: There is no indication of when cursor is "behind" an unfocused, floating window. Solution: Set underline cursor to indicate when an unfocused floatwin is over the active cursor.
2026-01-17vim-patch:9.0.0909: error message for layout change does not match action ↵zeertzjq1
(#37436) Problem: Error message for layout change does not match action. Solution: Pass the command to where the error is given. (closes vim/vim#11573) https://github.com/vim/vim/commit/9fda81515b26ecd3c1e99f95334aaed3f7b6fea3 Thinking about this again, it's actually OK to check split_disallowed in window_layout_locked(), so add the check. Also add missing window_layout_locked() in tabpage_close(). Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-01-05fix(window): crash closing split if autocmds close other splits (#37233)zeertzjq1
Problem: Crash when closing a split window if autocmds close other split windows but there are still floating windows. Solution: Bail out and give the window back its buffer.
2026-01-04fix(window): crash closing only non-float if autocmds :tabonly (#37218)Sean Dewar1
Problem: null pointer member access when closing the only non-float in the current tab page if autocommands after closing all floats also close all other tab pages. (making it the last window) Solution: check last_window again after closing the floats. Also reduce the scope of "wp"; it would be bugprone to use it before it's later reassigned to the rv of win_free_mem if freed by Buf/WinLeave.
2025-12-09fix(float): prevent truncation of title that fits exactly #36880skewb1k1
Problem: The `over_flow` parameter in `grid_draw_bordertext` always added 1 for the '<' character. As a result, titles that fit exactly were still truncated with an unnecessary '<'. Solution: Adjust `over_flow` only when the actual overflow is greater than 0. Fix #36872
2025-12-08fix(float): tail truncate long title #28387glepnir1
Problem: We truncate the title from start, this is somewhat inconsistent with the way vim works. Usually we use < to truncate and keep more trailing characters. Solution: Keep more trailing characters.
2025-10-11fix(window): don't make hidden/unfocusable previous window current #36142luukvbaal1
Problem: Previous window is made current while it is unfocusable/hidden. Solution: Treat hidden/unfocusable window as an invalid previous window.
2025-10-11fix: stale lines("w$") after nvim_win_set_height when splitkeep=screen #36056phanium1
Problem: when splitkeep=screen, after enlarge float window with nvim_win_set_height, lines("w$") return stale value Solution: update in win_set_inner_size
2025-10-11fix(float): crash from nasty :fclose autocmds (#36134)Sean Dewar1
Problem: :fclose may crash Nvim if autocommands close floats prematurely. Alternatively, :fclose may call win_close for windows not in curtab if autocommands change curtab or move windows between tab pages via nvim_win_set_config (may not crash, but is wrong). Solution: check win_valid before calling win_close.
2025-09-13feat(ui): support grid=0 in nvim_input_mouse #32535fredizzimo1
Problem: Multigrid UIs have to find out which window to send the input by using the Nvim focus rules, which are not fully documented. Furthermore,`getmousepos()` has several problems when multigrid is enabled, with the main one being that screenrow and screencol are window relative instead of screen relative, due to the fact that the UI don't send any absolute coordinates. Solution: Allow passing 0 as grid to `nvim_input_mouse`, with absolute coordinates, which lets nvim determine the actual window to send the mouse input to. This works as long as nvim is in charge of the window positioning. If the UI repositions or resizes the windows, it can still pass the grid it determines like before.
2025-08-27fix(floatwin): handle viewport width properly at end of window (#35490)zeertzjq1
Also avoid repeated calls of compute_foldcolumn().
2025-08-26fix(eval): winnrs of unfocusable/hidden windows #35474Sean Dewar1
Problem: various functions may return incorrect window numbers for unfocusable or hidden windows. Solution: fix the checks. Make sure current windows in non-current tabpages have a window number. Fixes #35453
2025-08-07fix(ui): check for cmdline mode properly (#35202)zeertzjq1
2025-07-11fix(window): don't store invalid height in window config (#34885)luukvbaal1
Problem: When 'winminheight' is zero and the window height is set to zero, the actual height is clamped whereas the stored config value is not. Reciprocal window configuration through nvim_win_get_config() then results in an error. Solution: Also clamp the stored dimensions in the window config.
2025-07-10fix(highlight): preserve bg transparency with winblend=100 #34825glepnir1
Problem: When winblend=100 is set on floating windows with transparent background, the desktop background is not visible through the window. Solution: Add special case to preserve transparency (-1) when blend ratio is 100% and background was originally transparent.
2025-07-09feat(option): custom chars in 'winborder' #33772glepnir1
Problem: winborder option only supported predefined styles and lacked support for custom border characters. Solution: implement parsing for comma-separated list format that allows specifying 8 individual border characters (topleft, top, topright, right, botright, bottom, botleft, left).
2025-06-29fix(help): :help can focus unfocusable/hide window #34442phanium1
Problem: :help/:helpgrep/:lhelpgrep can focus unfocusable/hide window Solution: Ignore unfocusable/hidden window when reusing help buffer.
2025-06-27fix(highlight): spurious underline in 'winblend' floating window #34614glepnir1
Problem: When a floating window with high winblend uses a highlight group with underline (but without guisp), the underline appears red. Solution: Only blend the special color (for underline/undercurl) if the foreground highlight actually has underline or undercurl set. Otherwise, ignore the special color.
2025-06-23fix(cmd): bar "|" not allowed after :fclose #34613glepnir1
Problem: `:fclose` command failed when used with trailing `|` bar. Solution: Add `TRLBAR` flag to fclose command to support trailing bar.
2025-06-12fix(float): ensure relative window grid is allocated (#34459)luukvbaal1
Problem: Uninitialized grid for a "win" relative float when redrawing just after it has been opened. Solution: Ensure window grid is allocated or assigned the default grid.
2025-06-09fix(highlight): preserve background transparency in 'winblend' #34302glepnir1
Problem: When using 'winblend', transparent backgrounds (-1) are forced to default colors (usually black) during attribute blending, breaking the transparency effect. Solution: Check original background colors before blending in hl_blend_attrs(). If both background and foreground originally had transparent backgrounds, preserve transparency instead of forcing default colors.
2025-06-08test: remove unnecessary line breaks #34369glepnir1
Problem: The test included too many unnecessary line breaks. Solution: Remove the extra line breaks to make the test code more concise.
2025-06-06fix(api): ensure win_get_config() "border" is reciprocal (#34322)luukvbaal1
fix(api): ensure win_get_config() is reciprocal Problem: win_get_config() does not include a 'none' border field, causing nvim_open_win() to apply the 'winborder' value. Solution: Include a 'none' border field in the returned config, such that it can be used reciprocally in nvim_open_win() to yield the same window layout.
2025-06-03fix(api): adjust fix for reconfiguring float "relative" (#34287)luukvbaal1
Problem: "win" is cleared in float config after 96330843, even with unchanged "relative". Solution: Don't clear "win". Avoid erroring for deleted "win" by setting the parent win to curwin directly when "win" is zero or not present in config.
2025-06-02fix(api): reconfiguring float "relative" does not clear "win" (#34271)luukvbaal1
Problem: Unable to change the "relative" of a flag after its target "win" no longer exists. Solution: Unset target window if it is not present in config and reconfigured "relative" no longer expects a target window.
2025-06-01fix(eval): winnr('$') counts non-current hidden/unfocusable windows #34207luukvbaal1
Problem: Non-visible/focusable windows are assigned a window number, whereas commands that use this window number skip over them. Solution: Skip over non-visible/focusable windows when computing the window number, unless it is made the current window through the API in which case an identifiable window number is still useful. This also ensures it matches the window number of the window entered by `<winnr>wincmd w` since 403fcacf.
2025-05-28vim-patch:9.1.1408: not easily possible to complete from register content ↵glepnir1
(#34198) Problem: not easily possible to complete from register content Solution: add register-completion submode using i_CTRL-X_CTRL-R (glepnir) closes: vim/vim#17354 https://github.com/vim/vim/commit/0546068aaef2b1a40faa2945ef7eba249739f219
2025-05-06refactor(tests): lint decorations_spec, float_spec, multigrid_spec #33274Justin M. Keyes1
Problem: decorations_spec.lua, float_spec.lua, multigrid_spec.lua are not auto-formatted. Solution: Add a special `formatlua2` cmake target, which invokes `stylua` with an alternative `.stylua2.toml` config.
2025-05-03fix(window): skip unfocusable and hidden floats with "{count}<C-W>w" #33810Sean Dewar1
Problem: Using `<C-W>w`, `<C-W>W` or the ":wincmd" variants with a count can enter unfocusable or hidden floating windows. This is especially problematic when using the new in-development extui, which creates many unfocusable floats for various UI elements. Solution: Skip unfocusable and hidden floating windows. Instead, skip to the next focusable, non-hidden window in the current tabpage's window list. Reword the documentation a bit (hopefully an improvement?)
2025-04-30fix(ui): correct condition for "wrap" flag in a floating gridbfredl1
In a floating window grid, "wrap" flag should not be set when vertical borders are used, as the the wrapped text will be broken up by border chars. fixes #33719
2025-04-27docs: lsp, emoji, startup #33446Justin M. Keyes1
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2025-04-23fix(winblend): treat braille blank (\u2800) as whitespace #32741Skoh1
Problem: 'winblend' does not display text behind blank unicode characters other than 0x20 ascii space. Solution: In ui_compositor.c -> compose_line() check for either 0x20 or 0x80A0E2 (utf8 \u2800).
2025-04-23fix(float): cursor visible in "hidden" floating window #30866glepnir1
Problem: Cursor is visible in "hidden" floating window. Solution: Hide cursor when curwin is a hidden floating window. Show cursor after returning to a normal (non-hidden) window.