From 9f5848cf10b5be49a049a3a0bd194048bf9f7842 Mon Sep 17 00:00:00 2001 From: Bakudankun Date: Sun, 27 Sep 2020 15:18:32 +0900 Subject: [PATCH] Fix traffic component returns a space when there is no trafic --- autoload/gina/component/traffic.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/gina/component/traffic.vim b/autoload/gina/component/traffic.vim index ba8405e..852340a 100644 --- a/autoload/gina/component/traffic.vim +++ b/autoload/gina/component/traffic.vim @@ -132,7 +132,7 @@ function! s:preset_ascii() abort let behind = gina#component#traffic#behind() let ahead = empty(ahead) ? '' : ('^' . ahead) let behind = empty(behind) ? '' : ('v' . behind) - return join([ahead, behind]) + return join(filter([ahead, behind], '!empty(v:val)')) endfunction function! s:preset_fancy() abort @@ -140,5 +140,5 @@ function! s:preset_fancy() abort let behind = gina#component#traffic#behind() let ahead = empty(ahead) ? '' : ('↑' . ahead) let behind = empty(behind) ? '' : ('↓' . behind) - return join([ahead, behind]) + return join(filter([ahead, behind], '!empty(v:val)')) endfunction