diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-04-22 13:31:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-22 13:31:41 +0200 |
commit | f2db5521eb545e451f261470c6bfc31dfac11887 (patch) | |
tree | 517117509ac6111e2cae27355d0b1aa207f2e47e /test/functional/ui/float_spec.lua | |
parent | fb5e2db4c72251ac8f59a7b80fc6d6b40dbec1d8 (diff) | |
parent | 5f18dd30137565da782c155b52b530c172b3b29d (diff) | |
download | rneovim-f2db5521eb545e451f261470c6bfc31dfac11887.tar.gz rneovim-f2db5521eb545e451f261470c6bfc31dfac11887.tar.bz2 rneovim-f2db5521eb545e451f261470c6bfc31dfac11887.zip |
Merge pull request #28434 from glepnir/23120
fix(float): wrong position when bufpos is out of range
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r-- | test/functional/ui/float_spec.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index d3a20ca021..99cb2e56f4 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -9275,6 +9275,43 @@ describe('float window', function() api.nvim_set_current_win(winid) eq("floating window cannot be relative to itself", pcall_err(api.nvim_win_set_config, winid, config)) end) + + it("bufpos out of range", function() + local buf = api.nvim_create_buf(false, true) + api.nvim_buf_set_lines(0, 0, -1, false, {}) + local config = { relative='win', width=5, height=2, row=0, col=0, bufpos = { 3, 3 } } + api.nvim_open_win(buf, false, config) + if multigrid then + screen:expect({ + grid = [[ + ## grid 1 + [2:----------------------------------------]|*6 + [3:----------------------------------------]| + ## grid 2 + ^ | + {0:~ }|*5 + ## grid 3 + | + ## grid 4 + {1: }| + {2:~ }| + ]], float_pos={ + [4] = {1001, "NW", 2, 0, 0, true, 50}; + }, win_viewport={ + [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}; + }}) + else + screen:expect({ + grid = [[ + {1:^ } | + {2:~ }{0: }| + {0:~ }|*4 + | + ]] + }) + end + end) end describe('with ext_multigrid', function() |