tabline: make middle-click work as expected in neovim

closes: #1854
This commit is contained in:
Christian Brabandt 2019-01-11 10:43:06 +01:00
parent 70b86537bd
commit d68c9bbeb2
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 3 additions and 2 deletions

View File

@ -207,7 +207,7 @@ function! airline#extensions#tabline#buffers#clickbuf(minwid, clicks, button, mo
elseif a:button is# 'm'
" middle button - delete buffer
if get(g:, 'airline#extensions#tabline#middle_click_preserves_windows', 0) == 0
if get(g:, 'airline#extensions#tabline#middle_click_preserves_windows', 0) == 0 || winnr('$') == 1
" just simply delete the clicked buffer. This will cause windows
" associated with the clicked buffer to be closed.
silent execute 'bdelete' a:minwid

View File

@ -963,7 +963,8 @@ Note: Enabling this extension will modify 'showtabline' and 'guioptions'.
won't update airline on |:badd| commands) >
let airline#extensions#tabline#disable_refresh = 0
* preserve windows when closing a buffer from the bufferline (default: 0) >
* preserve windows when closing a buffer from the bufferline (neovim specific,
only works with buffers and not real tabs, default: 0) >
let airline#extensions#tabline#middle_click_preserves_windows = 1
<
------------------------------------- *airline-taboo*