diff options
author | Munif Tanjim <hello@muniftanjim.dev> | 2023-04-02 23:01:10 +0600 |
---|---|---|
committer | Munif Tanjim <hello@muniftanjim.dev> | 2023-04-10 16:26:42 +0600 |
commit | da979ae04b7a8c56586ed0233957600ad6af99f0 (patch) | |
tree | cbd4e93374b0161198028d9dd97310e52bcd537b /test/functional/ui/float_spec.lua | |
parent | 53f36806f1b5107c0570ffbf57180a8e08f45b2e (diff) | |
download | rneovim-da979ae04b7a8c56586ed0233957600ad6af99f0.tar.gz rneovim-da979ae04b7a8c56586ed0233957600ad6af99f0.tar.bz2 rneovim-da979ae04b7a8c56586ed0233957600ad6af99f0.zip |
fix(api): do not re-apply win_config.style when missing
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r-- | test/functional/ui/float_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 32f28dce26..6d9197e1df 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -432,6 +432,25 @@ describe('float window', function() assert_alive() end) + it("should re-apply 'style' when present", function() + local float_opts = {style = 'minimal', relative = 'editor', row = 1, col = 1, width = 1, height = 1} + local float_win = meths.open_win(0, true, float_opts) + meths.win_set_option(float_win, 'number', true) + float_opts.row = 2 + meths.win_set_config(float_win, float_opts) + eq(false, meths.win_get_option(float_win, 'number')) + end) + + it("should not re-apply 'style' when missing", function() + local float_opts = {style = 'minimal', relative = 'editor', row = 1, col = 1, width = 1, height = 1} + local float_win = meths.open_win(0, true, float_opts) + meths.win_set_option(float_win, 'number', true) + float_opts.row = 2 + float_opts.style = nil + meths.win_set_config(float_win, float_opts) + eq(true, meths.win_get_option(float_win, 'number')) + end) + it("'scroll' is computed correctly when opening float with splitkeep=screen #20684", function() meths.set_option('splitkeep', 'screen') local float_opts = {relative = 'editor', row = 1, col = 1, width = 10, height = 10} |