xP: make middle click close buffers

As if they were tabs, to save pointless typing.
This commit is contained in:
Přemysl Eric Janouch 2023-04-13 04:25:58 +02:00
parent 6bfe577f1b
commit af5f209c53
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 8 additions and 0 deletions

View File

@ -465,6 +465,14 @@ let BufferList = {
// The role makes it selectable in VIM-like browser extensions.
return m('.item[role=tab]', {
onclick: event => bufferActivate(name),
onauxclick: event => {
if (event.button == 1)
rpc.send({
command: 'BufferInput',
bufferName: name,
text: '/buffer close',
})
},
class: classes.join(' '),
}, displayName)
})