From d68c9bbeb2d93fa2798a0cf2266b7f169ecf560b Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Fri, 11 Jan 2019 10:43:06 +0100 Subject: [PATCH] tabline: make middle-click work as expected in neovim closes: #1854 --- autoload/airline/extensions/tabline/buffers.vim | 2 +- doc/airline.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/tabline/buffers.vim b/autoload/airline/extensions/tabline/buffers.vim index 35b9e98f..88ebe5c8 100644 --- a/autoload/airline/extensions/tabline/buffers.vim +++ b/autoload/airline/extensions/tabline/buffers.vim @@ -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 diff --git a/doc/airline.txt b/doc/airline.txt index 8fa558ff..5ef18d32 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -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*