aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFelipe Morales <hel.sheep@gmail.com>2014-12-23 11:56:10 -0300
committerJustin M. Keyes <justinkz@gmail.com>2015-02-16 23:24:30 -0500
commit66d94869a0f01902d93597eae4244f9a64db82fc (patch)
tree268c3d71cfd37f77eecc5f830c92e62364405c21 /test
parent817be96be535a8aecc24a72f51fe2d6743ed4a24 (diff)
downloadrneovim-66d94869a0f01902d93597eae4244f9a64db82fc.tar.gz
rneovim-66d94869a0f01902d93597eae4244f9a64db82fc.tar.bz2
rneovim-66d94869a0f01902d93597eae4244f9a64db82fc.zip
Add TabNewEntered
TabNewEntered is triggered after vim has entered a buffer in new tab.
Diffstat (limited to 'test')
-rw-r--r--test/functional/autocmd/tabnewentered_spec.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/autocmd/tabnewentered_spec.lua b/test/functional/autocmd/tabnewentered_spec.lua
new file mode 100644
index 0000000000..f220c15ef7
--- /dev/null
+++ b/test/functional/autocmd/tabnewentered_spec.lua
@@ -0,0 +1,24 @@
+local helpers = require('test.functional.helpers')
+local clear, nvim, buffer, curbuf, curwin, eq, neq, ok =
+ helpers.clear, helpers.nvim, helpers.buffer, helpers.curbuf, helpers.curwin,
+ helpers.eq, helpers.neq, helpers.ok
+
+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("\ntabnewentered:2:2", nvim('command_output', 'tabnew'))
+ eq("\n\"test.x2\" [New File]\ntabnewentered:3:3", nvim('command_output', 'tabnew test.x2'))
+ end)
+ end)
+ describe('with FILE as <afile>', function()
+ it('matches when opening a new tab for FILE', function()
+ tmp_path = nvim('eval', 'tempname()')
+ nvim('command', 'au! TabNewEntered '..tmp_path..' echom "tabnewentered:match"')
+ eq("\n\""..tmp_path.."\" [New File]\ntabnewentered:4:4\ntabnewentered:match", nvim('command_output', 'tabnew '..tmp_path))
+ end)
+ end)
+ end)
+end)