Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #273 from Bakudankun/fix-traffic-preset
Browse files Browse the repository at this point in the history
Fix traffic component returns a space when there is no traffic
  • Loading branch information
lambdalisue authored Sep 27, 2020
2 parents 0b2d343 + 9f5848c commit d1454a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoload/gina/component/traffic.vim
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ 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
let ahead = gina#component#traffic#ahead()
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

0 comments on commit d1454a3

Please sign in to comment.