diff options
author | Raphael <glephunter@gmail.com> | 2024-04-13 14:36:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-13 14:36:17 +0800 |
commit | 3ea124a8d9f08dd9f9af3bc0877f7b888a47f10b (patch) | |
tree | 5701da0262d7f08e99a9189ae69269fc91186f44 /test/functional/ui/float_spec.lua | |
parent | f064e72b9b9cc89059638f00876353d5a1b30c21 (diff) | |
download | rneovim-3ea124a8d9f08dd9f9af3bc0877f7b888a47f10b.tar.gz rneovim-3ea124a8d9f08dd9f9af3bc0877f7b888a47f10b.tar.bz2 rneovim-3ea124a8d9f08dd9f9af3bc0877f7b888a47f10b.zip |
fix(float): improve error message when reconfig failed (#25076)
Problem: The current error message isn't very accurate.
Solution: Improve the error message.
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r-- | test/functional/ui/float_spec.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 41b5b6ed2f..ed66557ee8 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -325,6 +325,27 @@ describe('float window', function() eq(12, pos[2]) end) + it('error message when reconfig missing relative field', function() + local bufnr = api.nvim_create_buf(false, true) + local opts = { + width = 10, + height = 10, + col = 5, + row = 5, + relative = 'editor', + style = 'minimal', + } + local win_id = api.nvim_open_win(bufnr, true, opts) + eq( + "Missing 'relative' field when reconfiguring floating window 1001", + pcall_err(api.nvim_win_set_config, win_id, { + width = 3, + height = 3, + row = 10, + col = 10, + })) + end) + it('is not operated on by windo when non-focusable #15374', function() command([[ let winids = [] |