diff options
author | glepnir <glephunter@gmail.com> | 2025-03-19 20:16:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-19 12:16:20 +0000 |
commit | 0e59f6f4c7cd376926fc5027b42a94e12cb017fe (patch) | |
tree | 7798d82a9a4949d92750a8f3b719892b95539aba /test/functional/api/window_spec.lua | |
parent | 74fcc9452cd99680a9f4aad255e90204966f74c3 (diff) | |
download | rneovim-0e59f6f4c7cd376926fc5027b42a94e12cb017fe.tar.gz rneovim-0e59f6f4c7cd376926fc5027b42a94e12cb017fe.tar.bz2 rneovim-0e59f6f4c7cd376926fc5027b42a94e12cb017fe.zip |
fix(api): don't use 'winborder' when reconfiguring float (#32984)
Problem: Reconfiguring a float window applies the global 'winborder'.
Solution:
- Ignore 'winborder' when reconfiguring a float window.
- Still apply 'winborder' when converting a split to a float window.
Diffstat (limited to 'test/functional/api/window_spec.lua')
-rw-r--r-- | test/functional/api/window_spec.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index 119c185b72..34b3b2dbe0 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -1907,6 +1907,38 @@ describe('API/win', function() end) describe('set_config', function() + it("uses 'winborder' when converting a split to a floating window", function() + api.nvim_set_option_value('winborder', 'single', {}) + command('split') + local winid = api.nvim_get_current_win() + -- Convert split to float without specifying border + api.nvim_win_set_config(winid, { + relative = 'editor', + row = 2, + col = 2, + width = 10, + height = 5, + }) + local config = api.nvim_win_get_config(winid) + eq('┌', config.border[1]) + end) + + it('erases border of a floating window when converting to split window', function() + api.nvim_set_option_value('winborder', 'single', {}) + local winid = api.nvim_open_win(api.nvim_create_buf(false, false), false, { + relative = 'editor', + row = 2, + col = 2, + width = 10, + height = 5, + }) + local config = api.nvim_win_get_config(winid) + eq('┌', config.border[1]) + api.nvim_win_set_config(winid, { split = 'right', win = 0 }) + config = api.nvim_win_get_config(winid) + eq(nil, config.border) + end) + it('moves a split into a float', function() local win = api.nvim_open_win(0, true, { vertical = false, |