2018-12-18 04:50:44 -07:00
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
|
|
|
local Screen = require('test.functional.ui.screen')
|
2018-12-23 10:37:45 -07:00
|
|
|
local clear = helpers.clear
|
2018-12-18 04:50:44 -07:00
|
|
|
local feed, command, insert = helpers.feed, helpers.command, helpers.insert
|
|
|
|
local eq = helpers.eq
|
2022-08-24 06:02:45 -07:00
|
|
|
local funcs = helpers.funcs
|
2019-01-01 04:46:47 -07:00
|
|
|
local meths = helpers.meths
|
2022-08-24 06:02:45 -07:00
|
|
|
local curwin = helpers.curwin
|
2020-10-19 11:17:51 -07:00
|
|
|
local poke_eventloop = helpers.poke_eventloop
|
2018-12-18 04:50:44 -07:00
|
|
|
|
|
|
|
|
2019-01-01 04:46:47 -07:00
|
|
|
describe('ext_multigrid', function()
|
2018-12-18 04:50:44 -07:00
|
|
|
local screen
|
|
|
|
|
|
|
|
before_each(function()
|
2019-04-16 16:38:59 -07:00
|
|
|
clear{args_rm={'--headless'}, args={'--cmd', 'set laststatus=2'}}
|
2018-12-23 10:37:45 -07:00
|
|
|
screen = Screen.new(53,14)
|
2018-12-18 04:50:44 -07:00
|
|
|
screen:attach({ext_multigrid=true})
|
|
|
|
screen:set_default_attr_ids({
|
|
|
|
[1] = {bold = true, foreground = Screen.colors.Blue1},
|
|
|
|
[2] = {foreground = Screen.colors.Magenta},
|
|
|
|
[3] = {foreground = Screen.colors.Brown, bold = true},
|
|
|
|
[4] = {foreground = Screen.colors.SlateBlue},
|
|
|
|
[5] = {bold = true, foreground = Screen.colors.SlateBlue},
|
|
|
|
[6] = {foreground = Screen.colors.Cyan4},
|
|
|
|
[7] = {bold = true},
|
|
|
|
[8] = {underline = true, bold = true, foreground = Screen.colors.SlateBlue},
|
|
|
|
[9] = {foreground = Screen.colors.SlateBlue, underline = true},
|
|
|
|
[10] = {foreground = Screen.colors.Red},
|
|
|
|
[11] = {bold = true, reverse = true},
|
|
|
|
[12] = {reverse = true},
|
|
|
|
[13] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey},
|
2018-11-18 02:00:27 -07:00
|
|
|
[14] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
|
|
|
|
[15] = {bold = true, foreground = Screen.colors.SeaGreen4},
|
|
|
|
[16] = {background = Screen.colors.LightGrey, underline = true},
|
|
|
|
[17] = {background = Screen.colors.LightGrey, underline = true, bold = true, foreground = Screen.colors.Magenta},
|
|
|
|
[18] = {bold = true, foreground = Screen.colors.Magenta},
|
|
|
|
[19] = {foreground = Screen.colors.Brown},
|
2021-09-10 07:24:41 -07:00
|
|
|
[20] = {background = Screen.colors.LightGrey},
|
2023-05-01 19:00:34 -07:00
|
|
|
[21] = {background = Screen.colors.LightMagenta},
|
|
|
|
[22] = {background = Screen.colors.LightMagenta, bold = true, foreground = Screen.colors.Blue},
|
2023-05-01 19:36:41 -07:00
|
|
|
[23] = {background = Screen.colors.Grey90},
|
2023-05-02 15:17:53 -07:00
|
|
|
[24] = {background = Screen.colors.Grey},
|
2018-12-18 04:50:44 -07:00
|
|
|
})
|
|
|
|
end)
|
|
|
|
|
|
|
|
it('default initial screen', function()
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
|
|
|
|
it('positions windows correctly', function()
|
|
|
|
command('vsplit')
|
2019-08-17 11:52:08 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[2:--------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-12-18 04:50:44 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-08-17 11:52:08 -07:00
|
|
|
]], condition=function()
|
2018-12-18 04:50:44 -07:00
|
|
|
eq({
|
2019-08-17 11:52:08 -07:00
|
|
|
[2] = { win = {id=1000}, startrow = 0, startcol = 27, width = 26, height = 12 },
|
2019-09-01 02:25:00 -07:00
|
|
|
[4] = { win = {id=1001}, startrow = 0, startcol = 0, width = 26, height = 12 }
|
2018-12-18 04:50:44 -07:00
|
|
|
}, screen.win_position)
|
2019-08-17 11:52:08 -07:00
|
|
|
end}
|
2018-12-18 04:50:44 -07:00
|
|
|
command('wincmd l')
|
|
|
|
command('split')
|
2019-08-17 11:52:08 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[5:--------------------------]|*6
|
2022-05-15 09:34:44 -07:00
|
|
|
[4:--------------------------]│{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[2:--------------------------]|*5
|
2018-12-18 04:50:44 -07:00
|
|
|
{12:[No Name] [No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-12-18 04:50:44 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-12-18 04:50:44 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-08-17 11:52:08 -07:00
|
|
|
]], condition=function()
|
2018-12-18 04:50:44 -07:00
|
|
|
eq({
|
2019-08-17 11:52:08 -07:00
|
|
|
[2] = { win = {id=1000}, startrow = 7, startcol = 27, width = 26, height = 5 },
|
2019-09-01 02:25:00 -07:00
|
|
|
[4] = { win = {id=1001}, startrow = 0, startcol = 0, width = 26, height = 12 },
|
|
|
|
[5] = { win = {id=1002}, startrow = 0, startcol = 27, width = 26, height = 6 }
|
2018-12-18 04:50:44 -07:00
|
|
|
}, screen.win_position)
|
2019-08-17 11:52:08 -07:00
|
|
|
end}
|
2018-12-18 04:50:44 -07:00
|
|
|
command('wincmd h')
|
|
|
|
command('q')
|
2019-08-17 11:52:08 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:-----------------------------------------------------]|*6
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2018-12-18 04:50:44 -07:00
|
|
|
{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 5
|
2018-12-18 04:50:44 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-08-17 11:52:08 -07:00
|
|
|
]], condition=function()
|
2018-12-18 04:50:44 -07:00
|
|
|
eq({
|
2019-08-17 11:52:08 -07:00
|
|
|
[2] = { win = {id=1000}, startrow = 7, startcol = 0, width = 53, height = 5 },
|
2019-09-01 02:25:00 -07:00
|
|
|
[5] = { win = {id=1002}, startrow = 0, startcol = 0, width = 53, height = 6 }
|
2018-12-18 04:50:44 -07:00
|
|
|
}, screen.win_position)
|
2019-08-17 11:52:08 -07:00
|
|
|
end}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
|
|
|
|
describe('split', function ()
|
|
|
|
describe('horizontally', function ()
|
|
|
|
it('allocates grids', function ()
|
|
|
|
command('sp')
|
|
|
|
screen:expect([[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2018-12-18 04:50:44 -07:00
|
|
|
{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-12-18 04:50:44 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2018-12-18 04:50:44 -07:00
|
|
|
]])
|
|
|
|
end)
|
|
|
|
|
|
|
|
it('resizes grids', function ()
|
|
|
|
command('sp')
|
|
|
|
command('resize 8')
|
|
|
|
screen:expect([[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*8
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*3
|
2018-12-18 04:50:44 -07:00
|
|
|
{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*2
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-12-18 04:50:44 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*7
|
2018-12-18 04:50:44 -07:00
|
|
|
]])
|
|
|
|
end)
|
|
|
|
|
|
|
|
it('splits vertically', function()
|
|
|
|
command('sp')
|
|
|
|
command('vsp')
|
|
|
|
command('vsp')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[6:--------------------]│[5:----------------]│[4:---------------]|*6
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }{12:[No Name] [No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2018-12-18 04:50:44 -07:00
|
|
|
{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-12-18 04:50:44 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-12-18 04:50:44 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 6
|
2018-12-18 04:50:44 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
insert('hello')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[6:--------------------]│[5:----------------]│[4:---------------]|*6
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] [No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2018-12-18 04:50:44 -07:00
|
|
|
{12:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
hello |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-12-18 04:50:44 -07:00
|
|
|
hello |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-12-18 04:50:44 -07:00
|
|
|
hello |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 6
|
2018-12-18 04:50:44 -07:00
|
|
|
hell^o |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
it('closes splits', function ()
|
|
|
|
command('sp')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2018-11-17 10:23:42 -07:00
|
|
|
{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-11-17 10:23:42 -07:00
|
|
|
## grid 2
|
2018-12-18 04:50:44 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2018-11-17 10:23:42 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-11-17 10:23:42 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-17 10:23:42 -07:00
|
|
|
command('q')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-17 10:23:42 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
describe('vertically', function ()
|
|
|
|
it('allocates grids', function ()
|
|
|
|
command('vsp')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[2:--------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-12-18 04:50:44 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
it('resizes grids', function ()
|
|
|
|
command('vsp')
|
|
|
|
command('vertical resize 10')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:----------]│[2:------------------------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:<No Name] }{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-12-18 04:50:44 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
it('splits horizontally', function ()
|
|
|
|
command('vsp')
|
|
|
|
command('sp')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:--------------------------]│[2:--------------------------]|*6
|
2022-05-15 09:34:44 -07:00
|
|
|
{11:[No Name] }│[2:--------------------------]|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[2:--------------------------]|*5
|
2018-12-18 04:50:44 -07:00
|
|
|
{12:[No Name] [No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-12-18 04:50:44 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-12-18 04:50:44 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
insert('hello')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:--------------------------]│[2:--------------------------]|*6
|
2022-05-15 09:34:44 -07:00
|
|
|
{11:[No Name] [+] }│[2:--------------------------]|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[2:--------------------------]|*5
|
2018-12-18 04:50:44 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
hello |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-12-18 04:50:44 -07:00
|
|
|
hello |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-12-18 04:50:44 -07:00
|
|
|
hell^o |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
it('closes splits', function ()
|
|
|
|
command('vsp')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-17 10:23:42 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[2:--------------------------]|*12
|
2018-11-17 10:23:42 -07:00
|
|
|
{11:[No Name] }{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-11-17 10:23:42 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2018-11-17 10:23:42 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-11-17 10:23:42 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
command('q')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
describe('on resize', function ()
|
|
|
|
it('rebuilds all grids', function ()
|
|
|
|
screen:try_resize(25, 6)
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-------------------------]|*4
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
|
|
|
|
it('has minimum width/height values', function()
|
|
|
|
screen:try_resize(1, 1)
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2018-11-17 10:23:42 -07:00
|
|
|
[2:------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
^ |
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
|
|
|
|
feed('<esc>:ls')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2018-11-17 10:23:42 -07:00
|
|
|
[2:------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
:ls^ |
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
describe('grid of smaller inner size', function()
|
|
|
|
it('is rendered correctly', function()
|
|
|
|
screen:try_resize_grid(2, 8, 5)
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
describe('grid of bigger inner size', function()
|
|
|
|
it('is rendered correctly', function()
|
|
|
|
screen:try_resize_grid(2, 80, 20)
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*19
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
2018-11-18 02:00:27 -07:00
|
|
|
|
2018-12-18 04:50:44 -07:00
|
|
|
describe('with resized grid', function()
|
|
|
|
before_each(function()
|
|
|
|
screen:try_resize_grid(2, 60, 20)
|
|
|
|
end)
|
2022-08-24 06:02:45 -07:00
|
|
|
|
|
|
|
it('winwidth() winheight() getwininfo() return inner width and height #19743', function()
|
|
|
|
eq(60, funcs.winwidth(0))
|
|
|
|
eq(20, funcs.winheight(0))
|
|
|
|
local win_info = funcs.getwininfo(curwin().id)[1]
|
|
|
|
eq(60, win_info.width)
|
|
|
|
eq(20, win_info.height)
|
|
|
|
end)
|
|
|
|
|
2023-12-17 19:15:23 -07:00
|
|
|
it("'scroll' option works properly", function()
|
|
|
|
eq(10, meths.get_option_value('scroll', { win = 0 }))
|
|
|
|
meths.set_option_value('scroll', 15, { win = 0 })
|
|
|
|
eq(15, meths.get_option_value('scroll', { win = 0 }))
|
|
|
|
end)
|
|
|
|
|
2018-12-18 04:50:44 -07:00
|
|
|
it('gets written till grid width', function()
|
|
|
|
insert(('a'):rep(60).."\n")
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*18
|
2023-05-01 20:09:27 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
|
|
|
end)
|
|
|
|
|
|
|
|
it('"g$" works correctly with double-width characters and no wrapping', function()
|
|
|
|
command('set nowrap')
|
|
|
|
insert(('a'):rep(58) .. ('哦'):rep(3))
|
|
|
|
feed('0')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-05-01 20:09:27 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa哦|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*19
|
2023-05-01 20:09:27 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
|
|
|
feed('g$')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-05-01 20:09:27 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa^哦|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*19
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
|
|
|
|
it('wraps with grid width', function()
|
2023-05-01 19:36:41 -07:00
|
|
|
insert(('b'):rep(160).."\n")
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
2023-12-09 05:42:00 -07:00
|
|
|
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|*2
|
2023-05-01 19:36:41 -07:00
|
|
|
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
2018-12-18 04:50:44 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*16
|
2023-05-01 19:36:41 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
|
|
|
feed('2gk')
|
|
|
|
command('setlocal cursorline cursorlineopt=screenline')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-05-01 19:36:41 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|
|
|
|
|
{23:^bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb}|
|
|
|
|
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*16
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
|
|
|
|
it('displays messages with default grid width', function()
|
|
|
|
command('echomsg "this is a very very very very very very very very'..
|
|
|
|
' long message"')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*19
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
this is a very very very...ry very very long message |
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
|
|
|
|
|
|
|
it('creates folds with grid width', function()
|
|
|
|
insert('this is a fold\nthis is inside fold\nthis is outside fold')
|
|
|
|
feed('kzfgg')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2018-12-18 04:50:44 -07:00
|
|
|
{11:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-12-18 04:50:44 -07:00
|
|
|
## grid 2
|
|
|
|
{13:^+-- 2 lines: this is a fold································}|
|
|
|
|
this is outside fold |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*18
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
2023-05-01 19:00:34 -07:00
|
|
|
|
|
|
|
it('anchored float window "bufpos"', function()
|
|
|
|
insert(('c'):rep(1111))
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-05-01 19:00:34 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
2023-12-09 05:42:00 -07:00
|
|
|
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|*18
|
2023-05-01 19:00:34 -07:00
|
|
|
cccccccccccccccccccccccccccccc^c |
|
|
|
|
{1:~ }|
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
|
|
|
local float_buf = meths.create_buf(false, false)
|
|
|
|
meths.open_win(float_buf, false, {
|
|
|
|
relative = 'win',
|
|
|
|
win = curwin(),
|
|
|
|
bufpos = {0, 1018},
|
|
|
|
anchor = 'SE',
|
|
|
|
width = 5,
|
|
|
|
height = 5,
|
|
|
|
})
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-05-01 19:00:34 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
2023-12-09 05:42:00 -07:00
|
|
|
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc|*18
|
2023-05-01 19:00:34 -07:00
|
|
|
cccccccccccccccccccccccccccccc^c |
|
|
|
|
{1:~ }|
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
{21: }|
|
2023-12-09 05:42:00 -07:00
|
|
|
{22:~ }|*4
|
2023-05-01 19:00:34 -07:00
|
|
|
]], float_pos={
|
|
|
|
[4] = {{id = 1001}, "SE", 2, 16, 58, true, 50};
|
|
|
|
}}
|
|
|
|
end)
|
2023-05-02 15:17:53 -07:00
|
|
|
|
|
|
|
it('completion popup position', function()
|
|
|
|
insert(('\n'):rep(14) .. ('foo bar '):rep(7))
|
|
|
|
feed('A<C-X><C-N>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-05-02 15:17:53 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
2023-12-09 05:42:00 -07:00
|
|
|
|*14
|
2023-05-02 15:17:53 -07:00
|
|
|
foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 15:17:53 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- Keyword Local completion (^N^P) }{15:match 1 of 2} |
|
|
|
|
## grid 4
|
|
|
|
{24: foo}|
|
|
|
|
{21: bar}|
|
|
|
|
]], float_pos={
|
|
|
|
[4] = {{id = -1}, "NW", 2, 15, 55, false, 100};
|
|
|
|
}}
|
|
|
|
feed('<C-E><Esc>')
|
|
|
|
|
|
|
|
command('setlocal rightleft')
|
|
|
|
feed('o<C-X><C-N>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-05-02 15:17:53 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
2023-12-09 05:42:00 -07:00
|
|
|
|*14
|
2023-05-02 15:17:53 -07:00
|
|
|
rab oof rab oof rab oof rab oof rab oof rab oof rab oof|
|
|
|
|
^ oof|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1: ~}|*4
|
2023-05-02 15:17:53 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- Keyword Local completion (^N^P) }{15:match 1 of 2} |
|
|
|
|
## grid 4
|
|
|
|
{24: oof}|
|
|
|
|
{21: rab}|
|
|
|
|
]], float_pos={
|
|
|
|
[4] = {{id = -1}, "NW", 2, 16, 45, false, 100};
|
|
|
|
}}
|
|
|
|
feed('<C-E><Esc>')
|
|
|
|
|
|
|
|
command('set wildoptions+=pum')
|
|
|
|
feed(':sign un<Tab>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-05-02 15:17:53 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
2023-12-09 05:42:00 -07:00
|
|
|
|*14
|
2023-05-02 15:17:53 -07:00
|
|
|
rab oof rab oof rab oof rab oof rab oof rab oof rab oof|
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1: ~}|*4
|
2023-05-02 15:17:53 -07:00
|
|
|
## grid 3
|
|
|
|
:sign undefine^ |
|
|
|
|
## grid 4
|
|
|
|
{24: undefine }|
|
|
|
|
{21: unplace }|
|
|
|
|
]], float_pos={
|
|
|
|
[4] = {{id = -1}, "SW", 1, 13, 5, false, 250};
|
|
|
|
}}
|
|
|
|
end)
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
|
|
it('multiline messages scroll over windows', function()
|
|
|
|
command('sp')
|
|
|
|
command('vsp')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:--------------------------]│[4:--------------------------]|*6
|
2018-11-18 02:00:27 -07:00
|
|
|
{11:[No Name] }{12:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2018-11-18 02:00:27 -07:00
|
|
|
{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-11-18 02:00:27 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
|
|
feed(":echoerr 'very' | echoerr 'much' | echoerr 'fail'<cr>")
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:--------------------------]│[4:--------------------------]|*6
|
2018-11-18 02:00:27 -07:00
|
|
|
{11:[No Name] }{12:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*3
|
|
|
|
[3:-----------------------------------------------------]|*4
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
{14:very} |
|
|
|
|
{14:much} |
|
|
|
|
{14:fail} |
|
|
|
|
{15:Press ENTER or type command to continue}^ |
|
|
|
|
## grid 4
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
|
|
feed('<cr>')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:--------------------------]│[4:--------------------------]|*6
|
2018-11-18 02:00:27 -07:00
|
|
|
{11:[No Name] }{12:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2018-11-18 02:00:27 -07:00
|
|
|
{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-11-18 02:00:27 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
|
|
command([[
|
|
|
|
func! ErrMsg()
|
2018-12-23 10:37:45 -07:00
|
|
|
for i in range(11)
|
2018-11-18 02:00:27 -07:00
|
|
|
echoerr "error ".i
|
|
|
|
endfor
|
|
|
|
endfunc]])
|
|
|
|
feed(":call ErrMsg()<cr>")
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[3:-----------------------------------------------------]|*14
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
2018-11-18 02:00:27 -07:00
|
|
|
{14:Error detected while processing function ErrMsg:} |
|
|
|
|
{19:line 2:} |
|
|
|
|
{14:error 0} |
|
|
|
|
{14:error 1} |
|
|
|
|
{14:error 2} |
|
|
|
|
{14:error 3} |
|
|
|
|
{14:error 4} |
|
|
|
|
{14:error 5} |
|
|
|
|
{14:error 6} |
|
|
|
|
{14:error 7} |
|
|
|
|
{14:error 8} |
|
|
|
|
{14:error 9} |
|
|
|
|
{14:error 10} |
|
2018-12-23 10:37:45 -07:00
|
|
|
{15:Press ENTER or type command to continue}^ |
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 4
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
|
|
feed("<c-c>")
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:--------------------------]│[4:--------------------------]|*6
|
2018-11-18 02:00:27 -07:00
|
|
|
{11:[No Name] }{12:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2018-11-18 02:00:27 -07:00
|
|
|
{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-11-18 02:00:27 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
end)
|
|
|
|
|
2019-08-17 12:46:11 -07:00
|
|
|
it('handles switch tabs', function()
|
2018-11-18 02:00:27 -07:00
|
|
|
command('vsp')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[2:--------------------------]|*12
|
2018-11-18 02:00:27 -07:00
|
|
|
{11:[No Name] }{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-11-18 02:00:27 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
command('tabnew')
|
|
|
|
-- note the old grids aren't resized yet
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
|
|
|
{16: }{17:2}{16: [No Name] }{7: [No Name] }{12: }{16:X}|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:-----------------------------------------------------]|*11
|
2018-11-18 02:00:27 -07:00
|
|
|
{11:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-08-17 12:46:11 -07:00
|
|
|
## grid 2 (hidden)
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4 (hidden)
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-11-18 02:00:27 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*10
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
|
|
command('sp')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
|
|
|
{16: }{17:2}{16: [No Name] }{7: }{18:2}{7: [No Name] }{12: }{16:X}|
|
2023-12-09 05:42:00 -07:00
|
|
|
[6:-----------------------------------------------------]|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:-----------------------------------------------------]|*5
|
2018-11-18 02:00:27 -07:00
|
|
|
{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-08-17 12:46:11 -07:00
|
|
|
## grid 2 (hidden)
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4 (hidden)
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 6
|
2018-11-18 02:00:27 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
|
|
command('tabnext')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
|
|
|
{7: }{18:2}{7: [No Name] }{16: }{17:2}{16: [No Name] }{12: }{16:X}|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[2:--------------------------]|*11
|
2018-11-18 02:00:27 -07:00
|
|
|
{11:[No Name] }{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*10
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-11-18 02:00:27 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*10
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5 (hidden)
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 6 (hidden)
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
|
|
command('tabnext')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
|
|
|
{16: }{17:2}{16: [No Name] }{7: }{18:2}{7: [No Name] }{12: }{16:X}|
|
2023-12-09 05:42:00 -07:00
|
|
|
[6:-----------------------------------------------------]|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:-----------------------------------------------------]|*5
|
2018-11-18 02:00:27 -07:00
|
|
|
{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-08-17 12:46:11 -07:00
|
|
|
## grid 2 (hidden)
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*10
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4 (hidden)
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*10
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2018-11-18 02:00:27 -07:00
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 6
|
2018-11-18 02:00:27 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
|
2020-12-03 20:03:04 -07:00
|
|
|
command('tabnext')
|
|
|
|
command('$tabnew')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
|
|
|
{16: }{17:2}{16: [No Name] }{17:2}{16: [No Name] }{7: [No Name] }{12: }{16:X}|
|
2023-12-09 05:42:00 -07:00
|
|
|
[7:-----------------------------------------------------]|*11
|
2020-12-03 20:03:04 -07:00
|
|
|
{11:[No Name] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2 (hidden)
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*10
|
2020-12-03 20:03:04 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4 (hidden)
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*10
|
2020-12-03 20:03:04 -07:00
|
|
|
## grid 5 (hidden)
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2020-12-03 20:03:04 -07:00
|
|
|
## grid 6 (hidden)
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2020-12-03 20:03:04 -07:00
|
|
|
## grid 7
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*10
|
2020-12-03 20:03:04 -07:00
|
|
|
]]}
|
|
|
|
|
|
|
|
command('tabclose')
|
2018-11-18 02:00:27 -07:00
|
|
|
command('tabclose')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[2:--------------------------]|*12
|
2018-11-18 02:00:27 -07:00
|
|
|
{11:[No Name] }{12:[No Name] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2018-11-18 02:00:27 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2018-11-18 02:00:27 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2018-11-18 02:00:27 -07:00
|
|
|
end)
|
2019-01-01 04:46:47 -07:00
|
|
|
|
|
|
|
it('supports mouse', function()
|
|
|
|
insert('some text\nto be clicked')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2019-01-01 04:46:47 -07:00
|
|
|
{11:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicke^d |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*10
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2019-01-01 04:46:47 -07:00
|
|
|
|
|
|
|
meths.input_mouse('left', 'press', '', 2, 0, 5)
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2019-01-01 04:46:47 -07:00
|
|
|
{11:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 2
|
|
|
|
some ^text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*10
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]]}
|
2019-01-01 04:46:47 -07:00
|
|
|
|
|
|
|
feed(':new<cr>')
|
|
|
|
insert('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo')
|
|
|
|
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2019-01-01 04:46:47 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2019-01-01 04:46:47 -07:00
|
|
|
{12:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2019-01-01 04:46:47 -07:00
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing el|
|
|
|
|
it, sed do eiusm^o |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2019-01-01 04:46:47 -07:00
|
|
|
|
|
|
|
meths.input_mouse('left', 'press', '', 2, 1, 6)
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2019-01-01 04:46:47 -07:00
|
|
|
{12:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2019-01-01 04:46:47 -07:00
|
|
|
{11:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be ^clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2019-01-01 04:46:47 -07:00
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing el|
|
|
|
|
it, sed do eiusmo |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2019-01-01 04:46:47 -07:00
|
|
|
|
2019-09-01 02:25:00 -07:00
|
|
|
meths.input_mouse('left', 'press', '', 4, 1, 4)
|
|
|
|
screen:expect{grid=[[
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2019-01-01 04:46:47 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2019-01-01 04:46:47 -07:00
|
|
|
{12:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2019-01-01 04:46:47 -07:00
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing el|
|
|
|
|
it, ^sed do eiusmo |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2019-01-01 04:46:47 -07:00
|
|
|
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:try_resize_grid(4, 80, 2)
|
|
|
|
screen:expect{grid=[[
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2019-01-01 04:46:47 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2019-01-01 04:46:47 -07:00
|
|
|
{12:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2019-01-01 04:46:47 -07:00
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, ^sed do eiusmo |
|
|
|
|
{1:~ }|
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2019-01-01 04:46:47 -07:00
|
|
|
|
2019-09-01 02:25:00 -07:00
|
|
|
meths.input_mouse('left', 'press', '', 4, 0, 64)
|
|
|
|
screen:expect{grid=[[
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2019-01-01 04:46:47 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2019-01-01 04:46:47 -07:00
|
|
|
{12:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2019-01-01 04:46:47 -07:00
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ^eiusmo |
|
|
|
|
{1:~ }|
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2019-01-01 04:46:47 -07:00
|
|
|
|
2023-09-20 17:00:03 -07:00
|
|
|
-- XXX: mouse_check_grid() doesn't work properly when clicking on grid 1
|
2022-05-19 04:11:11 -07:00
|
|
|
meths.input_mouse('left', 'press', '', 1, 6, 20)
|
2019-01-01 04:46:47 -07:00
|
|
|
-- TODO(bfredl): "batching" input_mouse is formally not supported yet.
|
|
|
|
-- Normally it should work fine in async context when nvim is not blocked,
|
2020-10-19 11:17:51 -07:00
|
|
|
-- but add a poke_eventloop be sure.
|
|
|
|
poke_eventloop()
|
2019-01-01 04:46:47 -07:00
|
|
|
meths.input_mouse('left', 'drag', '', 1, 4, 20)
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2019-01-01 04:46:47 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*7
|
2019-01-01 04:46:47 -07:00
|
|
|
{12:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2019-01-01 04:46:47 -07:00
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ^eiusmo |
|
|
|
|
{1:~ }|
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2019-01-01 04:46:47 -07:00
|
|
|
|
|
|
|
feed('<c-w><c-w><c-w>v')
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2019-01-01 04:46:47 -07:00
|
|
|
{12:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:--------------------------]│[2:--------------------------]|*7
|
2019-01-01 04:46:47 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2019-01-01 04:46:47 -07:00
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo |
|
|
|
|
{1:~ }|
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2019-01-01 04:46:47 -07:00
|
|
|
some text |
|
|
|
|
to be ^clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2019-01-01 04:46:47 -07:00
|
|
|
|
2023-05-02 00:25:41 -07:00
|
|
|
meths.input_mouse('left', 'press', '', 1, 8, 26)
|
2020-10-19 11:17:51 -07:00
|
|
|
poke_eventloop()
|
2019-01-01 04:46:47 -07:00
|
|
|
meths.input_mouse('left', 'drag', '', 1, 6, 30)
|
2019-09-01 02:25:00 -07:00
|
|
|
screen:expect{grid=[[
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2019-01-01 04:46:47 -07:00
|
|
|
{12:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*7
|
2019-01-01 04:46:47 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
2019-09-01 02:25:00 -07:00
|
|
|
[3:-----------------------------------------------------]|
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-01-01 04:46:47 -07:00
|
|
|
## grid 3
|
2019-09-01 02:25:00 -07:00
|
|
|
|
|
|
|
|
## grid 4
|
2019-01-01 04:46:47 -07:00
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo |
|
|
|
|
{1:~ }|
|
2019-09-01 02:25:00 -07:00
|
|
|
## grid 5
|
2019-01-01 04:46:47 -07:00
|
|
|
some text |
|
|
|
|
to be ^clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2019-09-01 02:25:00 -07:00
|
|
|
]]}
|
2023-05-02 00:25:41 -07:00
|
|
|
|
|
|
|
command('aunmenu PopUp | vmenu PopUp.Copy y')
|
|
|
|
|
|
|
|
funcs.setreg('"', '')
|
|
|
|
meths.input_mouse('left', 'press', '2', 2, 1, 6)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*7
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] }{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be {20:clicke}^d |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- VISUAL --} |
|
|
|
|
## grid 4
|
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo |
|
|
|
|
{1:~ }|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be {20:clicked} |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
]]}
|
|
|
|
meths.input_mouse('right', 'press', '', 2, 1, 6)
|
|
|
|
meths.input_mouse('right', 'release', '', 2, 1, 6)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*7
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] }{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be {20:clicke}^d |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- VISUAL --} |
|
|
|
|
## grid 4
|
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo |
|
|
|
|
{1:~ }|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be {20:clicked} |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 6
|
|
|
|
{21: Copy }|
|
|
|
|
]], float_pos={
|
|
|
|
[6] = {{id = -1}, "NW", 2, 2, 5, false, 250};
|
|
|
|
}}
|
|
|
|
feed('<Down><CR>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*7
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] }{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be ^clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo |
|
|
|
|
{1:~ }|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
]]}
|
|
|
|
eq('clicked', funcs.getreg('"'))
|
|
|
|
|
|
|
|
funcs.setreg('"', '')
|
|
|
|
meths.input_mouse('left', 'press', '2', 4, 0, 64)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2023-05-02 00:25:41 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*7
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- VISUAL --} |
|
|
|
|
## grid 4
|
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do {20:eiusm}^o |
|
|
|
|
{1:~ }|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
]]}
|
|
|
|
meths.input_mouse('right', 'press', '', 4, 0, 64)
|
|
|
|
meths.input_mouse('right', 'release', '', 4, 0, 64)
|
2023-05-02 15:17:53 -07:00
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2023-05-02 15:17:53 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*7
|
2023-05-02 15:17:53 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 15:17:53 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- VISUAL --} |
|
|
|
|
## grid 4
|
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do {20:eiusm}^o |
|
|
|
|
{1:~ }|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 15:17:53 -07:00
|
|
|
## grid 6
|
|
|
|
{21: Copy }|
|
|
|
|
]], float_pos={
|
|
|
|
[6] = {{id = -1}, "NW", 4, 1, 63, false, 250};
|
|
|
|
}}
|
2023-05-02 00:25:41 -07:00
|
|
|
feed('<Down><CR>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2023-05-02 00:25:41 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*7
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ^eiusmo |
|
|
|
|
{1:~ }|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
]]}
|
|
|
|
eq('eiusmo', funcs.getreg('"'))
|
|
|
|
|
|
|
|
command('wincmd J')
|
|
|
|
screen:try_resize_grid(4, 7, 10)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2023-05-02 00:25:41 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
Lorem i|
|
|
|
|
psum do|
|
|
|
|
lor sit|
|
|
|
|
amet, |
|
|
|
|
consect|
|
|
|
|
etur ad|
|
|
|
|
ipiscin|
|
|
|
|
g elit,|
|
|
|
|
sed do|
|
|
|
|
^eiusmo|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 00:25:41 -07:00
|
|
|
]]}
|
|
|
|
|
|
|
|
funcs.setreg('"', '')
|
|
|
|
meths.input_mouse('left', 'press', '2', 4, 9, 1)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2023-05-02 00:25:41 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- VISUAL --} |
|
|
|
|
## grid 4
|
|
|
|
Lorem i|
|
|
|
|
psum do|
|
|
|
|
lor sit|
|
|
|
|
amet, |
|
|
|
|
consect|
|
|
|
|
etur ad|
|
|
|
|
ipiscin|
|
|
|
|
g elit,|
|
|
|
|
sed do|
|
|
|
|
{20:eiusm}^o|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 00:25:41 -07:00
|
|
|
]]}
|
|
|
|
meths.input_mouse('right', 'press', '', 4, 9, 1)
|
|
|
|
meths.input_mouse('right', 'release', '', 4, 9, 1)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2023-05-02 00:25:41 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- VISUAL --} |
|
|
|
|
## grid 4
|
|
|
|
Lorem i|
|
|
|
|
psum do|
|
|
|
|
lor sit|
|
|
|
|
amet, |
|
|
|
|
consect|
|
|
|
|
etur ad|
|
|
|
|
ipiscin|
|
|
|
|
g elit,|
|
|
|
|
sed do|
|
|
|
|
{20:eiusm}^o|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 6
|
|
|
|
{21: Copy }|
|
|
|
|
]], float_pos={
|
|
|
|
[6] = {{id = -1}, "SW", 4, 9, 0, false, 250};
|
|
|
|
}}
|
|
|
|
feed('<Down><CR>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*5
|
2023-05-02 00:25:41 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2023-05-02 00:25:41 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 00:25:41 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
Lorem i|
|
|
|
|
psum do|
|
|
|
|
lor sit|
|
|
|
|
amet, |
|
|
|
|
consect|
|
|
|
|
etur ad|
|
|
|
|
ipiscin|
|
|
|
|
g elit,|
|
|
|
|
sed do|
|
|
|
|
^eiusmo|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 15:17:53 -07:00
|
|
|
]]}
|
|
|
|
eq('eiusmo', funcs.getreg('"'))
|
|
|
|
|
|
|
|
screen:try_resize_grid(4, 7, 11)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*5
|
2023-05-02 15:17:53 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2023-05-02 15:17:53 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 15:17:53 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
2023-09-26 05:28:58 -07:00
|
|
|
Lorem i|
|
2023-05-02 15:17:53 -07:00
|
|
|
psum do|
|
|
|
|
lor sit|
|
|
|
|
amet, |
|
|
|
|
consect|
|
|
|
|
etur ad|
|
|
|
|
ipiscin|
|
|
|
|
g elit,|
|
|
|
|
sed do|
|
2023-09-26 05:28:58 -07:00
|
|
|
^eiusmo|
|
2023-05-02 15:17:53 -07:00
|
|
|
{1:~ }|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 15:17:53 -07:00
|
|
|
]]}
|
|
|
|
|
|
|
|
funcs.setreg('"', '')
|
|
|
|
meths.input_mouse('left', 'press', '2', 4, 9, 1)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*5
|
2023-05-02 15:17:53 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2023-05-02 15:17:53 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 15:17:53 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- VISUAL --} |
|
|
|
|
## grid 4
|
|
|
|
Lorem i|
|
|
|
|
psum do|
|
|
|
|
lor sit|
|
|
|
|
amet, |
|
|
|
|
consect|
|
|
|
|
etur ad|
|
|
|
|
ipiscin|
|
|
|
|
g elit,|
|
|
|
|
sed do|
|
|
|
|
{20:eiusm}^o|
|
|
|
|
{1:~ }|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 15:17:53 -07:00
|
|
|
]]}
|
|
|
|
meths.input_mouse('right', 'press', '', 4, 9, 1)
|
|
|
|
meths.input_mouse('right', 'release', '', 4, 9, 1)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*5
|
2023-05-02 15:17:53 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2023-05-02 15:17:53 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 15:17:53 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- VISUAL --} |
|
|
|
|
## grid 4
|
|
|
|
Lorem i|
|
|
|
|
psum do|
|
|
|
|
lor sit|
|
|
|
|
amet, |
|
|
|
|
consect|
|
|
|
|
etur ad|
|
|
|
|
ipiscin|
|
|
|
|
g elit,|
|
|
|
|
sed do|
|
|
|
|
{20:eiusm}^o|
|
|
|
|
{1:~ }|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 15:17:53 -07:00
|
|
|
## grid 6
|
|
|
|
{21: Copy }|
|
|
|
|
]], float_pos={
|
|
|
|
[6] = {{id = -1}, "NW", 4, 10, 0, false, 250};
|
|
|
|
}}
|
|
|
|
feed('<Down><CR>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:------------------------------]│[2:----------------------]|*5
|
2023-05-02 15:17:53 -07:00
|
|
|
{12:[No Name] [+] [No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2023-05-02 15:17:53 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 15:17:53 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
Lorem i|
|
|
|
|
psum do|
|
|
|
|
lor sit|
|
|
|
|
amet, |
|
|
|
|
consect|
|
|
|
|
etur ad|
|
|
|
|
ipiscin|
|
|
|
|
g elit,|
|
|
|
|
sed do|
|
|
|
|
^eiusmo|
|
|
|
|
{1:~ }|
|
|
|
|
## grid 5
|
|
|
|
some text |
|
|
|
|
to be clicked |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2023-05-02 00:25:41 -07:00
|
|
|
]]}
|
|
|
|
eq('eiusmo', funcs.getreg('"'))
|
2019-01-01 04:46:47 -07:00
|
|
|
end)
|
2020-01-23 10:05:04 -07:00
|
|
|
|
2021-09-10 07:24:41 -07:00
|
|
|
it('supports mouse drag with mouse=a', function()
|
|
|
|
command('set mouse=a')
|
|
|
|
command('vsplit')
|
|
|
|
command('wincmd l')
|
|
|
|
command('split')
|
|
|
|
command('enew')
|
|
|
|
feed('ifoo\nbar<esc>')
|
|
|
|
|
|
|
|
meths.input_mouse('left', 'press', '', 5, 0, 0)
|
|
|
|
poke_eventloop()
|
|
|
|
meths.input_mouse('left', 'drag', '', 5, 1, 2)
|
|
|
|
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[5:--------------------------]|*6
|
2022-05-15 09:34:44 -07:00
|
|
|
[4:--------------------------]│{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:--------------------------]│[2:--------------------------]|*5
|
2021-09-10 07:24:41 -07:00
|
|
|
{12:[No Name] [No Name] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2021-09-10 07:24:41 -07:00
|
|
|
## grid 3
|
|
|
|
{7:-- VISUAL --} |
|
|
|
|
## grid 4
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*11
|
2021-09-10 07:24:41 -07:00
|
|
|
## grid 5
|
|
|
|
{20:foo} |
|
|
|
|
{20:ba}^r |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2021-09-10 07:24:41 -07:00
|
|
|
]]}
|
|
|
|
end)
|
|
|
|
|
2020-01-23 10:05:04 -07:00
|
|
|
it('has viewport information', function()
|
|
|
|
screen:try_resize(48, 8)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*6
|
2020-01-23 10:05:04 -07:00
|
|
|
{11:[No Name] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2020-01-23 10:05:04 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = { id = 1000 }, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}
|
2020-01-23 10:05:04 -07:00
|
|
|
}}
|
|
|
|
insert([[
|
|
|
|
Lorem ipsum dolor sit amet, consectetur
|
|
|
|
adipisicing elit, sed do eiusmod tempor
|
|
|
|
incididunt ut labore et dolore magna aliqua.
|
|
|
|
Ut enim ad minim veniam, quis nostrud
|
|
|
|
exercitation ullamco laboris nisi ut aliquip ex
|
|
|
|
ea commodo consequat. Duis aute irure dolor in
|
|
|
|
reprehenderit in voluptate velit esse cillum
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint
|
|
|
|
occaecat cupidatat non proident, sunt in culpa
|
|
|
|
qui officia deserunt mollit anim id est
|
|
|
|
laborum.]])
|
|
|
|
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*6
|
2020-01-23 10:05:04 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
ea commodo consequat. Duis aute irure dolor in |
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
occaecat cupidatat non proident, sunt in culpa |
|
|
|
|
qui officia deserunt mollit anim id est |
|
|
|
|
laborum^. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 5, botline = 11, curline = 10, curcol = 7, linecount = 11, sum_scroll_delta = 5},
|
2020-01-23 10:05:04 -07:00
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
|
|
feed('<c-u>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*6
|
2020-01-23 10:05:04 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
incididunt ut labore et dolore magna aliqua. |
|
|
|
|
Ut enim ad minim veniam, quis nostrud |
|
|
|
|
exercitation ullamco laboris nisi ut aliquip ex |
|
|
|
|
ea commodo consequat. Duis aute irure dolor in |
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
^dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 2, botline = 9, curline = 7, curcol = 0, linecount = 11, sum_scroll_delta = 2},
|
2020-01-23 10:05:04 -07:00
|
|
|
}}
|
|
|
|
|
|
|
|
command("split")
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:------------------------------------------------]|*3
|
2020-01-23 10:05:04 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*2
|
2020-01-23 10:05:04 -07:00
|
|
|
{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
ea commodo consequat. Duis aute irure dolor in |
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
^dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 6, botline = 9, curline = 7, curcol = 0, linecount = 11, sum_scroll_delta = 6},
|
|
|
|
[4] = {win = {id = 1001}, topline = 5, botline = 9, curline = 7, curcol = 0, linecount = 11, sum_scroll_delta = 5},
|
2020-01-23 10:05:04 -07:00
|
|
|
}}
|
|
|
|
|
|
|
|
feed("b")
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:------------------------------------------------]|*3
|
2020-01-23 10:05:04 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*2
|
2020-01-23 10:05:04 -07:00
|
|
|
{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
ea commodo consequat. Duis aute irure dolor in |
|
|
|
|
reprehenderit in voluptate velit esse ^cillum |
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 6, botline = 9, curline = 7, curcol = 0, linecount = 11, sum_scroll_delta = 6},
|
|
|
|
[4] = {win = {id = 1001}, topline = 5, botline = 9, curline = 6, curcol = 38, linecount = 11, sum_scroll_delta = 5},
|
2020-01-23 10:05:04 -07:00
|
|
|
}}
|
|
|
|
|
|
|
|
feed("2k")
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:------------------------------------------------]|*3
|
2020-01-23 10:05:04 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*2
|
2020-01-23 10:05:04 -07:00
|
|
|
{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
exercitation ullamco laboris nisi ut a^liquip ex |
|
|
|
|
ea commodo consequat. Duis aute irure dolor in |
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 6, botline = 9, curline = 7, curcol = 0, linecount = 11, sum_scroll_delta = 6},
|
|
|
|
[4] = {win = {id = 1001}, topline = 4, botline = 8, curline = 4, curcol = 38, linecount = 11, sum_scroll_delta = 4},
|
2020-01-23 10:05:04 -07:00
|
|
|
}}
|
|
|
|
|
|
|
|
-- handles non-current window
|
|
|
|
meths.win_set_cursor(1000, {1, 10})
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:------------------------------------------------]|*3
|
2020-01-23 10:05:04 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*2
|
2020-01-23 10:05:04 -07:00
|
|
|
{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet, consectetur |
|
|
|
|
adipisicing elit, sed do eiusmod tempor |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
exercitation ullamco laboris nisi ut a^liquip ex |
|
|
|
|
ea commodo consequat. Duis aute irure dolor in |
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 3, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0},
|
|
|
|
[4] = {win = {id = 1001}, topline = 4, botline = 8, curline = 4, curcol = 38, linecount = 11, sum_scroll_delta = 4},
|
|
|
|
}}
|
|
|
|
|
|
|
|
-- sum_scroll_delta works with folds
|
|
|
|
feed('zfj')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:------------------------------------------------]|*3
|
2023-03-12 15:58:46 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*2
|
2023-03-12 15:58:46 -07:00
|
|
|
{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet, consectetur |
|
|
|
|
adipisicing elit, sed do eiusmod tempor |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
{13:^+-- 2 lines: exercitation ullamco laboris nisi }|
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 3, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0},
|
|
|
|
[4] = {win = {id = 1001}, topline = 4, botline = 9, curline = 4, curcol = 38, linecount = 11, sum_scroll_delta = 4},
|
|
|
|
}}
|
|
|
|
|
|
|
|
feed('<c-e>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:------------------------------------------------]|*3
|
2023-03-12 15:58:46 -07:00
|
|
|
{11:[No Name] [+] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*2
|
2023-03-12 15:58:46 -07:00
|
|
|
{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet, consectetur |
|
|
|
|
adipisicing elit, sed do eiusmod tempor |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
^reprehenderit in voluptate velit esse cillum |
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
occaecat cupidatat non proident, sunt in culpa |
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 3, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0},
|
|
|
|
[4] = {win = {id = 1001}, topline = 6, botline = 10, curline = 6, curcol = 0, linecount = 11, sum_scroll_delta = 5},
|
2020-01-23 10:05:04 -07:00
|
|
|
}}
|
2023-07-03 23:14:09 -07:00
|
|
|
|
|
|
|
command('close | 21vsplit | setlocal number smoothscroll')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:---------------------]│[2:--------------------------]|*6
|
2023-07-03 23:14:09 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet|
|
|
|
|
, consectetur |
|
|
|
|
adipisicing elit, sed do e|
|
|
|
|
iusmod tempor |
|
|
|
|
incididunt ut labore et do|
|
|
|
|
lore magna aliqua. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 5
|
|
|
|
{19: 1 }Lorem ipsu^m dolor|
|
|
|
|
{19: } sit amet, consec|
|
|
|
|
{19: }tetur |
|
|
|
|
{19: 2 }adipisicing elit,|
|
|
|
|
{19: } sed do eiusmod t|
|
|
|
|
{19: }empor |
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 4, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0};
|
|
|
|
[5] = {win = {id = 1002}, topline = 0, botline = 3, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0};
|
|
|
|
}}
|
|
|
|
|
|
|
|
feed('5<C-E>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:---------------------]│[2:--------------------------]|*6
|
2023-07-03 23:14:09 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet|
|
|
|
|
, consectetur |
|
|
|
|
adipisicing elit, sed do e|
|
|
|
|
iusmod tempor |
|
|
|
|
incididunt ut labore et do|
|
|
|
|
lore magna aliqua. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 5
|
|
|
|
{1:<<<}{19: }empo^r |
|
|
|
|
{19: 3 }incididunt ut lab|
|
|
|
|
{19: }ore et dolore mag|
|
|
|
|
{19: }na aliqua. |
|
|
|
|
{19: 4 }Ut enim ad minim |
|
|
|
|
{19: }veniam, quis n{1:@@@}|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 4, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0};
|
|
|
|
[5] = {win = {id = 1002}, topline = 1, botline = 4, curline = 1, curcol = 38, linecount = 11, sum_scroll_delta = 5};
|
|
|
|
}}
|
|
|
|
|
|
|
|
feed('<C-Y>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:---------------------]│[2:--------------------------]|*6
|
2023-07-03 23:14:09 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet|
|
|
|
|
, consectetur |
|
|
|
|
adipisicing elit, sed do e|
|
|
|
|
iusmod tempor |
|
|
|
|
incididunt ut labore et do|
|
|
|
|
lore magna aliqua. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 5
|
|
|
|
{1:<<<}{19: } sed do eiusmod t|
|
|
|
|
{19: }empo^r |
|
|
|
|
{19: 3 }incididunt ut lab|
|
|
|
|
{19: }ore et dolore mag|
|
|
|
|
{19: }na aliqua. |
|
|
|
|
{19: 4 }Ut enim ad min{1:@@@}|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 4, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0};
|
|
|
|
[5] = {win = {id = 1002}, topline = 1, botline = 4, curline = 1, curcol = 38, linecount = 11, sum_scroll_delta = 4};
|
|
|
|
}}
|
|
|
|
|
|
|
|
command('set cpoptions+=n')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:---------------------]│[2:--------------------------]|*6
|
2023-07-03 23:14:09 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet|
|
|
|
|
, consectetur |
|
|
|
|
adipisicing elit, sed do e|
|
|
|
|
iusmod tempor |
|
|
|
|
incididunt ut labore et do|
|
|
|
|
lore magna aliqua. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 5
|
|
|
|
{1:<<<}d do eiusmod tempo|
|
|
|
|
^r |
|
|
|
|
{19: 3 }incididunt ut lab|
|
|
|
|
ore et dolore magna a|
|
|
|
|
liqua. |
|
|
|
|
{19: 4 }Ut enim ad min{1:@@@}|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 4, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0};
|
|
|
|
[5] = {win = {id = 1002}, topline = 1, botline = 4, curline = 1, curcol = 38, linecount = 11, sum_scroll_delta = 4};
|
|
|
|
}}
|
|
|
|
|
|
|
|
feed('4<C-E>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:---------------------]│[2:--------------------------]|*6
|
2023-07-03 23:14:09 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet|
|
|
|
|
, consectetur |
|
|
|
|
adipisicing elit, sed do e|
|
|
|
|
iusmod tempor |
|
|
|
|
incididunt ut labore et do|
|
|
|
|
lore magna aliqua. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 5
|
|
|
|
{1:<<<}ua^. |
|
|
|
|
{19: 4 }Ut enim ad minim |
|
|
|
|
veniam, quis nostrud |
|
|
|
|
{19: 5 }exercitation ulla|
|
|
|
|
mco laboris nisi ut a|
|
|
|
|
liquip ex |
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 4, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0};
|
|
|
|
[5] = {win = {id = 1002}, topline = 2, botline = 6, curline = 2, curcol = 43, linecount = 11, sum_scroll_delta = 8};
|
|
|
|
}}
|
|
|
|
|
|
|
|
feed('2<C-Y>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:---------------------]│[2:--------------------------]|*6
|
2023-07-03 23:14:09 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet|
|
|
|
|
, consectetur |
|
|
|
|
adipisicing elit, sed do e|
|
|
|
|
iusmod tempor |
|
|
|
|
incididunt ut labore et do|
|
|
|
|
lore magna aliqua. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 5
|
|
|
|
{19: 3 }incididunt ut lab|
|
|
|
|
ore et dolore magna a|
|
|
|
|
liqua^. |
|
|
|
|
{19: 4 }Ut enim ad minim |
|
|
|
|
veniam, quis nostrud |
|
|
|
|
{19: 5 }exercitation u{1:@@@}|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 4, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0};
|
|
|
|
[5] = {win = {id = 1002}, topline = 2, botline = 5, curline = 2, curcol = 43, linecount = 11, sum_scroll_delta = 6};
|
|
|
|
}}
|
|
|
|
|
|
|
|
command('setlocal numberwidth=12')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:---------------------]│[2:--------------------------]|*6
|
2023-07-03 23:14:09 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet|
|
|
|
|
, consectetur |
|
|
|
|
adipisicing elit, sed do e|
|
|
|
|
iusmod tempor |
|
|
|
|
incididunt ut labore et do|
|
|
|
|
lore magna aliqua. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 5
|
|
|
|
{19: 3 }incididun|
|
|
|
|
t ut labore et dolore|
|
|
|
|
magna aliqua^. |
|
|
|
|
{19: 4 }Ut enim a|
|
|
|
|
d minim veniam, quis |
|
|
|
|
nostrud |
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 4, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0};
|
|
|
|
[5] = {win = {id = 1002}, topline = 2, botline = 5, curline = 2, curcol = 43, linecount = 11, sum_scroll_delta = 6};
|
|
|
|
}}
|
|
|
|
|
|
|
|
feed('2<C-E>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:---------------------]│[2:--------------------------]|*6
|
2023-07-03 23:14:09 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet|
|
|
|
|
, consectetur |
|
|
|
|
adipisicing elit, sed do e|
|
|
|
|
iusmod tempor |
|
|
|
|
incididunt ut labore et do|
|
|
|
|
lore magna aliqua. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 5
|
|
|
|
{1:<<<}gna aliqua^. |
|
|
|
|
{19: 4 }Ut enim a|
|
|
|
|
d minim veniam, quis |
|
|
|
|
nostrud |
|
|
|
|
{19: 5 }exercitat|
|
|
|
|
ion ullamco labori{1:@@@}|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 4, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0};
|
|
|
|
[5] = {win = {id = 1002}, topline = 2, botline = 5, curline = 2, curcol = 43, linecount = 11, sum_scroll_delta = 8};
|
|
|
|
}}
|
|
|
|
|
|
|
|
feed('<C-E>')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[5:---------------------]│[2:--------------------------]|*6
|
2023-07-03 23:14:09 -07:00
|
|
|
{11:[No Name] [+] }{12:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
Lorem ipsum dolor sit amet|
|
|
|
|
, consectetur |
|
|
|
|
adipisicing elit, sed do e|
|
|
|
|
iusmod tempor |
|
|
|
|
incididunt ut labore et do|
|
|
|
|
lore magna aliqua. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 5
|
|
|
|
{19: 4 }Ut enim a|
|
|
|
|
d minim veniam, quis |
|
|
|
|
nostru^d |
|
|
|
|
{19: 5 }exercitat|
|
|
|
|
ion ullamco laboris n|
|
|
|
|
isi ut aliquip ex |
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 4, curline = 0, curcol = 10, linecount = 11, sum_scroll_delta = 0};
|
|
|
|
[5] = {win = {id = 1002}, topline = 3, botline = 6, curline = 3, curcol = 36, linecount = 11, sum_scroll_delta = 9};
|
|
|
|
}}
|
2020-01-23 10:05:04 -07:00
|
|
|
end)
|
2021-07-14 11:53:58 -07:00
|
|
|
|
2023-07-04 01:48:53 -07:00
|
|
|
it('scroll_delta is approximated reasonably when scrolling many lines #24234', function()
|
|
|
|
command('setlocal number nowrap')
|
|
|
|
command('edit test/functional/fixtures/bigfile.txt')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-07-04 01:48:53 -07:00
|
|
|
{11:test/functional/fixtures/bigfile.txt }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
{19: 1 }^0000;<control>;Cc;0;BN;;;;;N;NULL;;;; |
|
|
|
|
{19: 2 }0001;<control>;Cc;0;BN;;;;;N;START OF HEADING;;|
|
|
|
|
{19: 3 }0002;<control>;Cc;0;BN;;;;;N;START OF TEXT;;;; |
|
|
|
|
{19: 4 }0003;<control>;Cc;0;BN;;;;;N;END OF TEXT;;;; |
|
|
|
|
{19: 5 }0004;<control>;Cc;0;BN;;;;;N;END OF TRANSMISSIO|
|
|
|
|
{19: 6 }0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
|
|
|
|
{19: 7 }0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
|
|
|
|
{19: 8 }0007;<control>;Cc;0;BN;;;;;N;BELL;;;; |
|
|
|
|
{19: 9 }0008;<control>;Cc;0;BN;;;;;N;BACKSPACE;;;; |
|
|
|
|
{19: 10 }0009;<control>;Cc;0;S;;;;;N;CHARACTER TABULATIO|
|
|
|
|
{19: 11 }000A;<control>;Cc;0;B;;;;;N;LINE FEED (LF);;;; |
|
|
|
|
{19: 12 }000B;<control>;Cc;0;S;;;;;N;LINE TABULATION;;;;|
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 13, curline = 0, curcol = 0, linecount = 30592, sum_scroll_delta = 0};
|
|
|
|
}}
|
|
|
|
feed('G')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-07-04 01:48:53 -07:00
|
|
|
{11:test/functional/fixtures/bigfile.txt }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
{19:30581 }E01E8;VARIATION SELECTOR-249;Mn;0;NSM;;;;;N;;;;|
|
|
|
|
{19:30582 }E01E9;VARIATION SELECTOR-250;Mn;0;NSM;;;;;N;;;;|
|
|
|
|
{19:30583 }E01EA;VARIATION SELECTOR-251;Mn;0;NSM;;;;;N;;;;|
|
|
|
|
{19:30584 }E01EB;VARIATION SELECTOR-252;Mn;0;NSM;;;;;N;;;;|
|
|
|
|
{19:30585 }E01EC;VARIATION SELECTOR-253;Mn;0;NSM;;;;;N;;;;|
|
|
|
|
{19:30586 }E01ED;VARIATION SELECTOR-254;Mn;0;NSM;;;;;N;;;;|
|
|
|
|
{19:30587 }E01EE;VARIATION SELECTOR-255;Mn;0;NSM;;;;;N;;;;|
|
|
|
|
{19:30588 }E01EF;VARIATION SELECTOR-256;Mn;0;NSM;;;;;N;;;;|
|
|
|
|
{19:30589 }F0000;<Plane 15 Private Use, First>;Co;0;L;;;;;|
|
|
|
|
{19:30590 }FFFFD;<Plane 15 Private Use, Last>;Co;0;L;;;;;N|
|
|
|
|
{19:30591 }100000;<Plane 16 Private Use, First>;Co;0;L;;;;|
|
|
|
|
{19:30592 }^10FFFD;<Plane 16 Private Use, Last>;Co;0;L;;;;;|
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 30580, botline = 30592, curline = 30591, curcol = 0, linecount = 30592, sum_scroll_delta = 30580};
|
|
|
|
}}
|
|
|
|
feed('gg')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-07-04 01:48:53 -07:00
|
|
|
{11:test/functional/fixtures/bigfile.txt }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
{19: 1 }^0000;<control>;Cc;0;BN;;;;;N;NULL;;;; |
|
|
|
|
{19: 2 }0001;<control>;Cc;0;BN;;;;;N;START OF HEADING;;|
|
|
|
|
{19: 3 }0002;<control>;Cc;0;BN;;;;;N;START OF TEXT;;;; |
|
|
|
|
{19: 4 }0003;<control>;Cc;0;BN;;;;;N;END OF TEXT;;;; |
|
|
|
|
{19: 5 }0004;<control>;Cc;0;BN;;;;;N;END OF TRANSMISSIO|
|
|
|
|
{19: 6 }0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
|
|
|
|
{19: 7 }0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
|
|
|
|
{19: 8 }0007;<control>;Cc;0;BN;;;;;N;BELL;;;; |
|
|
|
|
{19: 9 }0008;<control>;Cc;0;BN;;;;;N;BACKSPACE;;;; |
|
|
|
|
{19: 10 }0009;<control>;Cc;0;S;;;;;N;CHARACTER TABULATIO|
|
|
|
|
{19: 11 }000A;<control>;Cc;0;B;;;;;N;LINE FEED (LF);;;; |
|
|
|
|
{19: 12 }000B;<control>;Cc;0;S;;;;;N;LINE TABULATION;;;;|
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 13, curline = 0, curcol = 0, linecount = 30592, sum_scroll_delta = 0};
|
|
|
|
}}
|
|
|
|
command('setlocal wrap')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-07-04 01:48:53 -07:00
|
|
|
{11:test/functional/fixtures/bigfile.txt }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
{19: 1 }^0000;<control>;Cc;0;BN;;;;;N;NULL;;;; |
|
|
|
|
{19: 2 }0001;<control>;Cc;0;BN;;;;;N;START OF HEADING;;|
|
|
|
|
{19: };; |
|
|
|
|
{19: 3 }0002;<control>;Cc;0;BN;;;;;N;START OF TEXT;;;; |
|
|
|
|
{19: 4 }0003;<control>;Cc;0;BN;;;;;N;END OF TEXT;;;; |
|
|
|
|
{19: 5 }0004;<control>;Cc;0;BN;;;;;N;END OF TRANSMISSIO|
|
|
|
|
{19: }N;;;; |
|
|
|
|
{19: 6 }0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
|
|
|
|
{19: 7 }0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
|
|
|
|
{19: 8 }0007;<control>;Cc;0;BN;;;;;N;BELL;;;; |
|
|
|
|
{19: 9 }0008;<control>;Cc;0;BN;;;;;N;BACKSPACE;;;; |
|
|
|
|
{19: 10 }0009;<control>;Cc;0;S;;;;;N;CHARACTER TABULA{1:@@@}|
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 10, curline = 0, curcol = 0, linecount = 30592, sum_scroll_delta = 0};
|
|
|
|
}}
|
|
|
|
feed('G')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-07-04 01:48:53 -07:00
|
|
|
{11:test/functional/fixtures/bigfile.txt }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
{19:30587 }E01EE;VARIATION SELECTOR-255;Mn;0;NSM;;;;;N;;;;|
|
|
|
|
{19: }; |
|
|
|
|
{19:30588 }E01EF;VARIATION SELECTOR-256;Mn;0;NSM;;;;;N;;;;|
|
|
|
|
{19: }; |
|
|
|
|
{19:30589 }F0000;<Plane 15 Private Use, First>;Co;0;L;;;;;|
|
|
|
|
{19: }N;;;;; |
|
|
|
|
{19:30590 }FFFFD;<Plane 15 Private Use, Last>;Co;0;L;;;;;N|
|
|
|
|
{19: };;;;; |
|
|
|
|
{19:30591 }100000;<Plane 16 Private Use, First>;Co;0;L;;;;|
|
|
|
|
{19: };N;;;;; |
|
|
|
|
{19:30592 }^10FFFD;<Plane 16 Private Use, Last>;Co;0;L;;;;;|
|
|
|
|
{19: }N;;;;; |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 30586, botline = 30592, curline = 30591, curcol = 0, linecount = 30592, sum_scroll_delta = 30588};
|
|
|
|
}}
|
|
|
|
feed('gg')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*12
|
2023-07-04 01:48:53 -07:00
|
|
|
{11:test/functional/fixtures/bigfile.txt }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
{19: 1 }^0000;<control>;Cc;0;BN;;;;;N;NULL;;;; |
|
|
|
|
{19: 2 }0001;<control>;Cc;0;BN;;;;;N;START OF HEADING;;|
|
|
|
|
{19: };; |
|
|
|
|
{19: 3 }0002;<control>;Cc;0;BN;;;;;N;START OF TEXT;;;; |
|
|
|
|
{19: 4 }0003;<control>;Cc;0;BN;;;;;N;END OF TEXT;;;; |
|
|
|
|
{19: 5 }0004;<control>;Cc;0;BN;;;;;N;END OF TRANSMISSIO|
|
|
|
|
{19: }N;;;; |
|
|
|
|
{19: 6 }0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
|
|
|
|
{19: 7 }0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
|
|
|
|
{19: 8 }0007;<control>;Cc;0;BN;;;;;N;BELL;;;; |
|
|
|
|
{19: 9 }0008;<control>;Cc;0;BN;;;;;N;BACKSPACE;;;; |
|
|
|
|
{19: 10 }0009;<control>;Cc;0;S;;;;;N;CHARACTER TABULA{1:@@@}|
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 10, curline = 0, curcol = 0, linecount = 30592, sum_scroll_delta = 0};
|
|
|
|
}}
|
|
|
|
end)
|
|
|
|
|
2021-07-14 11:53:58 -07:00
|
|
|
it('does not crash when dragging mouse across grid boundary', function()
|
|
|
|
screen:try_resize(48, 8)
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*6
|
2021-07-14 11:53:58 -07:00
|
|
|
{11:[No Name] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2021-07-14 11:53:58 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = { id = 1000 }, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0}
|
2021-07-14 11:53:58 -07:00
|
|
|
}}
|
|
|
|
insert([[
|
|
|
|
Lorem ipsum dolor sit amet, consectetur
|
|
|
|
adipisicing elit, sed do eiusmod tempor
|
|
|
|
incididunt ut labore et dolore magna aliqua.
|
|
|
|
Ut enim ad minim veniam, quis nostrud
|
|
|
|
exercitation ullamco laboris nisi ut aliquip ex
|
|
|
|
ea commodo consequat. Duis aute irure dolor in
|
|
|
|
reprehenderit in voluptate velit esse cillum
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint
|
|
|
|
occaecat cupidatat non proident, sunt in culpa
|
|
|
|
qui officia deserunt mollit anim id est
|
|
|
|
laborum.]])
|
|
|
|
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*6
|
2021-07-14 11:53:58 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
ea commodo consequat. Duis aute irure dolor in |
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
occaecat cupidatat non proident, sunt in culpa |
|
|
|
|
qui officia deserunt mollit anim id est |
|
|
|
|
laborum^. |
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 5, botline = 11, curline = 10, curcol = 7, linecount = 11, sum_scroll_delta = 5},
|
2021-07-14 11:53:58 -07:00
|
|
|
}}
|
|
|
|
|
|
|
|
meths.input_mouse('left', 'press', '', 1,5, 1)
|
|
|
|
poke_eventloop()
|
|
|
|
meths.input_mouse('left', 'drag', '', 1, 6, 1)
|
|
|
|
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:------------------------------------------------]|*6
|
2021-07-14 11:53:58 -07:00
|
|
|
{11:[No Name] [+] }|
|
|
|
|
[3:------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
reprehenderit in voluptate velit esse cillum |
|
|
|
|
dolore eu fugiat nulla pariatur. Excepteur sint |
|
|
|
|
occaecat cupidatat non proident, sunt in culpa |
|
|
|
|
qui officia deserunt mollit anim id est |
|
|
|
|
l^aborum. |
|
|
|
|
{1:~ }|
|
|
|
|
## grid 3
|
|
|
|
{7:-- VISUAL --} |
|
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 6, botline = 12, curline = 10, curcol = 1, linecount = 11, sum_scroll_delta = 6},
|
2021-07-14 11:53:58 -07:00
|
|
|
}}
|
|
|
|
end)
|
2022-05-18 04:51:59 -07:00
|
|
|
|
|
|
|
it('with winbar', function()
|
2022-11-28 17:56:41 -07:00
|
|
|
command('split')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2022-11-28 17:56:41 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2022-11-28 17:56:41 -07:00
|
|
|
{12:[No Name] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2022-11-28 17:56:41 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2022-11-28 17:56:41 -07:00
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
|
|
|
[4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
2022-11-28 17:56:41 -07:00
|
|
|
}}
|
|
|
|
|
|
|
|
-- XXX: hack to get notifications. Could use next_msg() also.
|
|
|
|
local orig_handle_win_pos = screen._handle_win_pos
|
|
|
|
local win_pos = {}
|
|
|
|
function screen._handle_win_pos(self, grid, win, startrow, startcol, width, height)
|
|
|
|
table.insert(win_pos, {grid, win, startrow, startcol, width, height})
|
|
|
|
orig_handle_win_pos(self, grid, win, startrow, startcol, width, height)
|
|
|
|
end
|
|
|
|
|
|
|
|
command('setlocal winbar=very%=bar')
|
2022-05-18 04:51:59 -07:00
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2022-05-18 04:51:59 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2022-05-18 04:51:59 -07:00
|
|
|
{12:[No Name] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2022-05-18 04:51:59 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
2022-11-28 17:56:41 -07:00
|
|
|
{7:very bar}|
|
2022-05-18 04:51:59 -07:00
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2022-05-18 04:51:59 -07:00
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
|
|
|
[4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
2022-05-18 04:51:59 -07:00
|
|
|
}}
|
2022-11-28 17:56:41 -07:00
|
|
|
eq({}, win_pos)
|
|
|
|
|
|
|
|
command('setlocal winbar=')
|
|
|
|
screen:expect{grid=[[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2022-11-28 17:56:41 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2022-11-28 17:56:41 -07:00
|
|
|
{12:[No Name] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2022-11-28 17:56:41 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2022-11-28 17:56:41 -07:00
|
|
|
]], win_viewport={
|
2023-03-12 15:58:46 -07:00
|
|
|
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
|
|
|
[4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
|
2022-11-28 17:56:41 -07:00
|
|
|
}}
|
|
|
|
eq({}, win_pos)
|
2022-05-18 04:51:59 -07:00
|
|
|
end)
|
2022-05-19 04:11:11 -07:00
|
|
|
|
|
|
|
it('with winbar dragging statusline with mouse works correctly', function()
|
2022-12-19 09:37:45 -07:00
|
|
|
meths.set_option_value('winbar', 'Set Up The Bars', {})
|
2022-05-19 04:11:11 -07:00
|
|
|
command('split')
|
|
|
|
screen:expect([[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*6
|
2022-05-19 04:11:11 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2022-05-19 04:11:11 -07:00
|
|
|
{12:[No Name] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
{7:Set Up The Bars }|
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2022-05-19 04:11:11 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
{7:Set Up The Bars }|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*4
|
2022-05-19 04:11:11 -07:00
|
|
|
]])
|
|
|
|
|
|
|
|
meths.input_mouse('left', 'press', '', 1, 6, 20)
|
|
|
|
poke_eventloop()
|
|
|
|
meths.input_mouse('left', 'drag', '', 1, 7, 20)
|
|
|
|
screen:expect([[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*7
|
2022-05-19 04:11:11 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*4
|
2022-05-19 04:11:11 -07:00
|
|
|
{12:[No Name] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
{7:Set Up The Bars }|
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*2
|
2022-05-19 04:11:11 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
{7:Set Up The Bars }|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2022-05-19 04:11:11 -07:00
|
|
|
]])
|
|
|
|
|
|
|
|
meths.input_mouse('left', 'drag', '', 1, 4, 20)
|
|
|
|
screen:expect([[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2022-05-19 04:11:11 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*7
|
2022-05-19 04:11:11 -07:00
|
|
|
{12:[No Name] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
{7:Set Up The Bars }|
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2022-05-19 04:11:11 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
{7:Set Up The Bars }|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*2
|
2022-05-19 04:11:11 -07:00
|
|
|
]])
|
|
|
|
|
|
|
|
meths.input_mouse('left', 'press', '', 1, 12, 10)
|
|
|
|
poke_eventloop()
|
|
|
|
meths.input_mouse('left', 'drag', '', 1, 10, 10)
|
|
|
|
screen:expect([[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2022-05-19 04:11:11 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*5
|
2022-05-19 04:11:11 -07:00
|
|
|
{12:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[3:-----------------------------------------------------]|*3
|
2022-05-19 04:11:11 -07:00
|
|
|
## grid 2
|
|
|
|
{7:Set Up The Bars }|
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*3
|
2022-05-19 04:11:11 -07:00
|
|
|
## grid 3
|
2023-12-09 05:42:00 -07:00
|
|
|
|*3
|
2022-05-19 04:11:11 -07:00
|
|
|
## grid 4
|
|
|
|
{7:Set Up The Bars }|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*2
|
2022-05-19 04:11:11 -07:00
|
|
|
]])
|
2022-12-19 09:37:45 -07:00
|
|
|
eq(3, meths.get_option_value('cmdheight', {}))
|
2022-05-19 04:11:11 -07:00
|
|
|
|
|
|
|
meths.input_mouse('left', 'drag', '', 1, 12, 10)
|
|
|
|
screen:expect([[
|
|
|
|
## grid 1
|
2023-12-09 05:42:00 -07:00
|
|
|
[4:-----------------------------------------------------]|*4
|
2022-05-19 04:11:11 -07:00
|
|
|
{11:[No Name] }|
|
2023-12-09 05:42:00 -07:00
|
|
|
[2:-----------------------------------------------------]|*7
|
2022-05-19 04:11:11 -07:00
|
|
|
{12:[No Name] }|
|
|
|
|
[3:-----------------------------------------------------]|
|
|
|
|
## grid 2
|
|
|
|
{7:Set Up The Bars }|
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*5
|
2022-05-19 04:11:11 -07:00
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
## grid 4
|
|
|
|
{7:Set Up The Bars }|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
{1:~ }|*2
|
2022-05-19 04:11:11 -07:00
|
|
|
]])
|
2022-12-19 09:37:45 -07:00
|
|
|
eq(1, meths.get_option_value('cmdheight', {}))
|
2022-05-19 04:11:11 -07:00
|
|
|
end)
|
2018-12-18 04:50:44 -07:00
|
|
|
end)
|