aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-11-16 14:24:13 +0100
committerThomas Vigouroux <tomvig38@gmail.com>2020-11-16 14:37:24 +0100
commit6a2cd5788687053ae613dced05c261a876f3ca46 (patch)
tree54a3a1ad0536d38f59da3ceeda89f15304a2c773 /test/functional/ui/float_spec.lua
parent6169167f90ba316b01cc64046ca46774bb1a22d7 (diff)
downloadrneovim-6a2cd5788687053ae613dced05c261a876f3ca46.tar.gz
rneovim-6a2cd5788687053ae613dced05c261a876f3ca46.tar.bz2
rneovim-6a2cd5788687053ae613dced05c261a876f3ca46.zip
fix(floatwin): don't always use winheight
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index eec8eb93d4..32f9ae030f 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -83,6 +83,50 @@ describe('floatwin', function()
assert_alive()
end)
+ it('opened with correct height', function()
+ local height = exec_lua([[
+ vim.api.nvim_set_option("winheight", 20)
+ local bufnr = vim.api.nvim_create_buf(false, true)
+
+ local opts = {
+ height = 10,
+ col = 5,
+ row = 1,
+ relative = 'editor',
+ style = 'minimal',
+ width = 15
+ }
+
+ local win_id = vim.api.nvim_open_win(bufnr, true, opts)
+
+ return vim.api.nvim_win_get_height(win_id)
+ ]])
+
+ eq(10, height)
+ end)
+
+ it('opened with correct width', function()
+ local width = exec_lua([[
+ vim.api.nvim_set_option("winwidth", 20)
+ local bufnr = vim.api.nvim_create_buf(false, true)
+
+ local opts = {
+ height = 10,
+ col = 5,
+ row = 1,
+ relative = 'editor',
+ style = 'minimal',
+ width = 10
+ }
+
+ local win_id = vim.api.nvim_open_win(bufnr, true, opts)
+
+ return vim.api.nvim_win_get_width(win_id)
+ ]])
+
+ eq(10, width)
+ end)
+
local function with_ext_multigrid(multigrid)
local screen
before_each(function()