mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
[RFC] Fix #4979: Trigger TabNewEntered also with <CTRL-W>T
Original patch by @fmoralesc
This commit is contained in:
parent
9fb8adf3ad
commit
43536568ba
@ -251,11 +251,14 @@ newwindow:
|
||||
if (win_new_tabpage((int)Prenum, NULL) == OK
|
||||
&& valid_tabpage(oldtab)) {
|
||||
newtab = curtab;
|
||||
goto_tabpage_tp(oldtab, TRUE, TRUE);
|
||||
if (curwin == wp)
|
||||
win_close(curwin, FALSE);
|
||||
if (valid_tabpage(newtab))
|
||||
goto_tabpage_tp(newtab, TRUE, TRUE);
|
||||
goto_tabpage_tp(oldtab, true, true);
|
||||
if (curwin == wp) {
|
||||
win_close(curwin, false);
|
||||
}
|
||||
if (valid_tabpage(newtab)) {
|
||||
goto_tabpage_tp(newtab, true, true);
|
||||
apply_autocmds(EVENT_TABNEWENTERED, NULL, NULL, false, curbuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -18,5 +18,14 @@ describe('TabNewEntered', function()
|
||||
eq("\n\""..tmp_path.."\" [New File]\ntabnewentered:4:4\ntabnewentered:match", nvim('command_output', 'tabnew '..tmp_path))
|
||||
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('\nentered', nvim('command_output', 'execute "normal \\<C-W>T"'))
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user