neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit da7580498a82252a9e13e29abd092d33a23bac22
parent 2a906bfad60b179a6ebe028c7d58ac44bc3545de
Author: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Date:   Wed,  4 Feb 2026 17:20:41 +0000

test(float): cursor unobscured by hidden float and in cmdline

Diffstat:
Mtest/functional/ui/float_spec.lua | 70+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 69 insertions(+), 1 deletion(-)

diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua @@ -11469,7 +11469,7 @@ describe('float window', function() zindex = 1, }) local buf2 = api.nvim_create_buf(false, false) - api.nvim_open_win(buf2, false, { + local float_win_above = api.nvim_open_win(buf2, false, { relative = 'editor', width = 10, height = 10, @@ -11661,6 +11661,74 @@ describe('float window', function() else screen:expect { mode = 'replace' } end + + -- Not obscured by a hidden floatwin. + api.nvim_win_set_config(float_win_above, { hide = true }) + if multigrid then + screen:expect({ + grid = [[ + ## grid 1 + [2:--------------------------------------------------]|*19 + [3:--------------------------------------------------]| + ## grid 2 + one | + two | + three | + {0:~ }|*16 + ## grid 3 + | + ## grid 7 + {5:┌─────┐}| + {5:│}{1:^ x}{5:│}| + {5:│}{2: ~}{5:│}|*4 + {5:└─────┘}| + ## grid 8 (hidden) + {1: }| + {2:~ }|*9 + ]], + float_pos = { + [7] = { 1004, 'NW', 1, 8, 8, true, 1, 1, 8, 8 }, + }, + mode = 'normal', + }) + else + screen:expect { mode = 'normal' } + end + + -- Not obscured in the command-line if curwin's cursor is obscured. + api.nvim_win_set_config(float_win_above, { hide = false }) + feed(':') + if multigrid then + screen:expect({ + grid = [[ + ## grid 1 + [2:--------------------------------------------------]|*19 + [3:--------------------------------------------------]| + ## grid 2 + one | + two | + three | + {0:~ }|*16 + ## grid 3 + :^ | + ## grid 7 + {5:┌─────┐}| + {5:│}{1: x}{5:│}| + {5:│}{2: ~}{5:│}|*4 + {5:└─────┘}| + ## grid 8 + {1: }| + {2:~ }|*9 + ]], + float_pos = { + [7] = { 1004, 'NW', 1, 8, 8, true, 1, 1, 8, 8 }, + [8] = { 1005, 'NW', 1, 0, 0, true, 2, 2, 0, 0 }, + }, + mode = 'cmdline_normal', + }) + else + screen:expect { mode = 'cmdline_normal' } + end end) end