aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp/utils_spec.lua
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2025-01-06 15:05:50 +0100
committerGitHub <noreply@github.com>2025-01-06 06:05:50 -0800
commit86770108e2c6e08c2b8b95f1611923ba99b854dd (patch)
tree5ce6e39933d3144a3b308488acc7d9c2d4533d56 /test/functional/plugin/lsp/utils_spec.lua
parent9b7905df16d841f4070cb4c460cd22af14784d5a (diff)
downloadrneovim-86770108e2c6e08c2b8b95f1611923ba99b854dd.tar.gz
rneovim-86770108e2c6e08c2b8b95f1611923ba99b854dd.tar.bz2
rneovim-86770108e2c6e08c2b8b95f1611923ba99b854dd.zip
fix(lsp): open_floating_preview() zindex relative to current window #31886
Problem: open_floating_preview() may be hidden behind current window if that is floating and has a higher zindex. Solution: Open floating preview with zindex higher than current window.
Diffstat (limited to 'test/functional/plugin/lsp/utils_spec.lua')
-rw-r--r--test/functional/plugin/lsp/utils_spec.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/functional/plugin/lsp/utils_spec.lua b/test/functional/plugin/lsp/utils_spec.lua
index ce6e6b2535..1e3e759e0b 100644
--- a/test/functional/plugin/lsp/utils_spec.lua
+++ b/test/functional/plugin/lsp/utils_spec.lua
@@ -301,4 +301,32 @@ describe('vim.lsp.util', function()
end)
end)
end)
+
+ it('open_floating_preview zindex greater than current window', function()
+ local screen = Screen.new()
+ exec_lua(function()
+ vim.api.nvim_open_win(0, true, {
+ relative = 'editor',
+ border = 'single',
+ height = 11,
+ width = 51,
+ row = 2,
+ col = 2,
+ })
+ vim.keymap.set('n', 'K', function()
+ vim.lsp.util.open_floating_preview({ 'foo' }, '', { border = 'single' })
+ end, {})
+ end)
+ feed('K')
+ screen:expect([[
+ ┌───────────────────────────────────────────────────┐|
+ │{4:^ }│|
+ │┌───┐{11: }│|
+ ││{4:foo}│{11: }│|
+ │└───┘{11: }│|
+ │{11:~ }│|*7
+ └───────────────────────────────────────────────────┘|
+ |
+ ]])
+ end)
end)