diff options
Diffstat (limited to 'test/functional/api/window_spec.lua')
-rw-r--r-- | test/functional/api/window_spec.lua | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index ceeb84cec9..bb72b63b6c 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -387,4 +387,50 @@ describe('API/win', function() eq({oldbuf}, meths.list_bufs()) end) end) + + describe('open_win', function() + it('noautocmd option works', function() + command('autocmd BufEnter,BufLeave,BufWinEnter * let g:fired = 1') + meths.open_win(meths.create_buf(true, true), true, { + relative='win', row=3, col=3, width=12, height=3, noautocmd=true + }) + eq(0, funcs.exists('g:fired')) + meths.open_win(meths.create_buf(true, true), true, { + relative='win', row=3, col=3, width=12, height=3 + }) + eq(1, funcs.exists('g:fired')) + end) + end) + + describe('get_config', function() + it('includes border', function() + local b = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h' } + local win = meths.open_win(0, true, { + relative='win', row=3, col=3, width=12, height=3, + border = b, + }) + + local cfg = meths.win_get_config(win) + eq(b, cfg.border) + end) + it('includes border with highlight group', function() + local b = { + {'a', 'Normal'}, + {'b', 'Special'}, + {'c', 'String'}, + {'d', 'Comment'}, + {'e', 'Visual'}, + {'f', 'Error'}, + {'g', 'Constant'}, + {'h', 'PreProc'}, + } + local win = meths.open_win(0, true, { + relative='win', row=3, col=3, width=12, height=3, + border = b, + }) + + local cfg = meths.win_get_config(win) + eq(b, cfg.border) + end) + end) end) |