From 13628d698d9be150714a60bb9eaa5b3b332132ab Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Thu, 5 May 2022 23:09:10 +0200 Subject: [PATCH] scrollbar: allow to customize minimum window width closes #2531 --- autoload/airline/extensions/scrollbar.vim | 3 ++- doc/airline.txt | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/scrollbar.vim b/autoload/airline/extensions/scrollbar.vim index ff84ff79..3d25a0c8 100644 --- a/autoload/airline/extensions/scrollbar.vim +++ b/autoload/airline/extensions/scrollbar.vim @@ -4,7 +4,8 @@ scriptencoding utf-8 function! airline#extensions#scrollbar#calculate() abort - if winwidth(0) > 200 && get(w:, 'airline_active', 0) + if winwidth(0) > get(g:, 'airline#extensions#scrollbar#minwidth', 200) + \ && get(w:, 'airline_active', 0) let overwrite = 0 if &encoding ==? 'utf-8' && !get(g:, 'airline_symbols_ascii', 0) let [left, right, middle] = [ '|', '|', '█'] diff --git a/doc/airline.txt b/doc/airline.txt index a80ef189..18b635d4 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -1394,6 +1394,10 @@ Displays an Ascii Scrollbar for active windows with a width > 200. * enable/disable scrollbar integration > let g:airline#extensions#scrollbar#enabled = 1 (default: 0) +* set minimum window width, below which the scollbar + will be disabled > + let g:airline#extensions#scrollbar#minwidth = 100 (default: 200) + ------------------------------------- *airline-taboo* taboo.vim