mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 02:08:17 +00:00
32 lines
1.2 KiB
Lua
32 lines
1.2 KiB
Lua
local helpers = require('test.functional.helpers')(after_each)
|
|
local clear, nvim, eq = helpers.clear, helpers.nvim, helpers.eq
|
|
|
|
describe('TabNewEntered', function()
|
|
describe('au TabNewEntered', function()
|
|
describe('with * as <afile>', function()
|
|
it('matches when entering any new tab', function()
|
|
clear()
|
|
nvim('command', 'au! TabNewEntered * echom "tabnewentered:".tabpagenr().":".bufnr("")')
|
|
eq("tabnewentered:2:2", nvim('exec', 'tabnew', true))
|
|
eq("tabnewentered:3:3", nvim('exec', 'tabnew test.x2', true))
|
|
end)
|
|
end)
|
|
describe('with FILE as <afile>', function()
|
|
it('matches when opening a new tab for FILE', function()
|
|
nvim('command', 'au! TabNewEntered Xtest-tabnewentered echom "tabnewentered:match"')
|
|
eq('tabnewentered:4:4\ntabnewentered:match',
|
|
nvim('exec', 'tabnew Xtest-tabnewentered', true))
|
|
end)
|
|
end)
|
|
describe('with CTRL-W T', function()
|
|
it('works when opening a new tab with CTRL-W T', function()
|
|
clear()
|
|
nvim('command', 'au! TabNewEntered * echom "entered"')
|
|
nvim('command', 'tabnew test.x2')
|
|
nvim('command', 'split')
|
|
eq('entered', nvim('exec', 'execute "normal \\<C-W>T"', true))
|
|
end)
|
|
end)
|
|
end)
|
|
end)
|