aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-05-05 07:09:04 +0200
committerGitHub <noreply@github.com>2021-05-05 07:09:04 +0200
commit7fcc59655760dcdb94b6939f293f5b2eeec5be77 (patch)
treefb3a048012bbad41cb3039eef8ac6049e979807b /test/functional/ui/float_spec.lua
parent1c2e504d5c394182d898dd161b9d9f75e1252b96 (diff)
parentca058082ae888f66393aa1c9fad7ed749a99bbf9 (diff)
downloadrneovim-7fcc59655760dcdb94b6939f293f5b2eeec5be77.tar.gz
rneovim-7fcc59655760dcdb94b6939f293f5b2eeec5be77.tar.bz2
rneovim-7fcc59655760dcdb94b6939f293f5b2eeec5be77.zip
Merge pull request #14483 from mjlbach/floating_window_border_fix
window.c: fix floating window border width calculation
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index ccb13a69d2..cd3bea6595 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -910,6 +910,57 @@ describe('float window', function()
end
end)
+ it('terminates border on edge of viewport when window extends past viewport', function()
+ local buf = meths.create_buf(false, false)
+ meths.open_win(buf, false, {relative='editor', width=40, height=7, row=0, col=0, border="single"})
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [2:----------------------------------------]|
+ [3:----------------------------------------]|
+ ## grid 2
+ ^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ## grid 3
+ |
+ ## grid 4
+ {5:┌────────────────────────────────────────┐}|
+ {5:│}{1: }{5:│}|
+ {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|
+ {5:└────────────────────────────────────────┘}|
+ ]], float_pos={
+ [4] = { { id = 1001 }, "NW", 1, 0, 0, true }
+ }, win_viewport={
+ [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0};
+ [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0};
+ }}
+ else
+ screen:expect{grid=[[
+ {5:^┌──────────────────────────────────────┐}|
+ {5:│}{1: }{5:│}|
+ {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|
+ {5:│}{2:~ }{5:│}|
+ {5:└──────────────────────────────────────┘}|
+ |
+ ]]}
+ end
+ end)
+
it('with border show popupmenu', function()
screen:try_resize(40,10)
local buf = meths.create_buf(false, false)