window: allow resize wincmds for floats

This commit is contained in:
Björn Linse
2019-06-10 15:42:09 +02:00
parent 44e150bd46
commit d11a146516
4 changed files with 374 additions and 22 deletions

View File

@@ -2663,6 +2663,356 @@ describe('floating windows', function()
end)
it("vertical resize + - _", function()
feed('<c-w>w')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
|
## grid 2
x |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
{1:^y }|
{2:~ }|
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }|
{0:~ }|
|
]])
end
feed('<c-w>+')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
|
## grid 2
x |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
{1:^y }|
{2:~ }|
{2:~ }|
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }|
|
]])
end
feed('<c-w>2-')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
|
## grid 2
x |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
{1:^y }|
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }|
{0:~ }|
{0:~ }|
|
]])
end
feed('<c-w>4_')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
|
## grid 2
x |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
{1:^y }|
{2:~ }|
{2:~ }|
{2:~ }|
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }{2:~ }{0: }|
|
]])
end
feed('<c-w>_')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
|
## grid 2
x |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
{1:^y }|
{2:~ }|
{2:~ }|
{2:~ }|
{2:~ }|
{2:~ }|
]], float_pos=expected_pos}
else
screen:expect([[
x {1:^y } |
{0:~ }{2:~ }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }{2:~ }{0: }|
|
]])
end
end)
it("horizontal resize > < |", function()
feed('<c-w>w')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
|
## grid 2
x |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
{1:^y }|
{2:~ }|
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }|
{0:~ }|
|
]])
end
feed('<c-w>>')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
|
## grid 2
x |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
{1:^y }|
{2:~ }|
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }|
{0:~ }|
|
]])
end
feed('<c-w>10<lt>')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
|
## grid 2
x |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
{1:^y }|
{2:~ }|
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }|
{0:~ }|
|
]])
end
feed('<c-w>15|')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
|
## grid 2
x |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
{1:^y }|
{2:~ }|
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{0:~ }{1:^y }{0: }|
{0:~ }{2:~ }{0: }|
{0:~ }|
{0:~ }|
|
]])
end
feed('<c-w>|')
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
|
## grid 2
x |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
{1:^y }|
{2:~ }|
]], float_pos=expected_pos}
else
screen:expect([[
x |
{0:~ }|
{1:^y }|
{2:~ }|
{0:~ }|
{0:~ }|
|
]])
end
end)
it("s :split (non-float)", function()
feed("<c-w>s")
if multigrid then