feat(tabline): middle mouse button now closes tab (#27522)

This commit is contained in:
Nacho Nieva
2024-02-18 23:49:33 -03:00
committed by GitHub
parent 8f1f2a1d9f
commit fa131de9ad
3 changed files with 55 additions and 30 deletions

View File

@@ -184,4 +184,18 @@ describe('tabline', function()
]],
}
end)
it('middle-click closes tab', function()
command('tabnew')
command('tabnew')
command('tabnew')
command('tabprev')
eq({ 3, 4 }, api.nvim_eval('[tabpagenr(), tabpagenr("$")]'))
api.nvim_input_mouse('middle', 'press', '', 0, 0, 1)
eq({ 2, 3 }, api.nvim_eval('[tabpagenr(), tabpagenr("$")]'))
api.nvim_input_mouse('middle', 'press', '', 0, 0, 20)
eq({ 2, 2 }, api.nvim_eval('[tabpagenr(), tabpagenr("$")]'))
api.nvim_input_mouse('middle', 'press', '', 0, 0, 1)
eq({ 1, 1 }, api.nvim_eval('[tabpagenr(), tabpagenr("$")]'))
end)
end)