From ee4afdeedb219a6a449bb8f42893e8fc53ae4478 Mon Sep 17 00:00:00 2001 From: Rick Jones Date: Wed, 8 Jul 2020 22:23:38 +0100 Subject: [PATCH] Dynamically resize section Z Resolves: #2168 --- autoload/airline/init.vim | 6 +++--- t/init.vim | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index 6a03c121..b3191d8d 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -149,7 +149,7 @@ function! airline#init#bootstrap() call airline#parts#define_raw('file', '%f%m') call airline#parts#define_raw('path', '%F%m') call airline#parts#define('linenr', { - \ 'raw': '%{g:airline_symbols.linenr}%4l', + \ 'raw': '%{g:airline_symbols.linenr}%l', \ 'accent': 'bold'}) call airline#parts#define('maxlinenr', { \ 'raw': '/%L%{g:airline_symbols.maxlinenr}', @@ -213,9 +213,9 @@ function! airline#init#sections() endif if !exists('g:airline_section_z') if airline#util#winwidth() > 79 - let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%3p%%'.spc, 'linenr', 'maxlinenr', spc.':%3v']) + let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%p%%'.spc, 'linenr', 'maxlinenr', ':%v']) else - let g:airline_section_z = airline#section#create(['%3p%%'.spc, 'linenr', ':%3v']) + let g:airline_section_z = airline#section#create(['%p%%'.spc, 'linenr', ':%v']) endif endif if !exists('g:airline_section_error') diff --git a/t/init.vim b/t/init.vim index c376a88d..6cc5620e 100644 --- a/t/init.vim +++ b/t/init.vim @@ -43,9 +43,9 @@ describe 'init sections' end it 'section z should be line numbers' - Expect g:airline_section_z =~ '%3p%%' - Expect g:airline_section_z =~ '%4l' - Expect g:airline_section_z =~ '%3v' + Expect g:airline_section_z =~ '%p%%' + Expect g:airline_section_z =~ '%l' + Expect g:airline_section_z =~ '%v' end it 'should not redefine sections already defined'