mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-13 14:03:51 -05:00
new function lightline#concatenate({list}, {num}) (close #18)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
" Version: 0.0
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2013/08/30 01:07:12.
|
||||
" Last Change: 2013/08/31 19:14:21.
|
||||
" =============================================================================
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
@@ -136,6 +136,15 @@ function! s:subseparator(x, y, s)
|
||||
\'(has_key(f,v:val)?"!!strlen(exists(\"*".f[v:val]."\")?".f[v:val]."():\"\")":get(v,v:val,has_key(c,v:val)?"1":"0"))'),')+(')."))?('".a:s."'):''}"
|
||||
endfunction
|
||||
|
||||
function! lightline#concatenate(x, s)
|
||||
let [_, k, s] = ['', 0, ' ' . [s:lightline.subseparator.left, s:lightline.subseparator.right][!!a:s] . ' ']
|
||||
for i in range(len(a:x))
|
||||
let [_, k] = [_ . a:x[i], k || len(a:x[i])]
|
||||
if k && i + 1 < len(a:x) && len(a:x[i + 1]) | let _ .= s | endif
|
||||
endfor
|
||||
return _
|
||||
endfunction
|
||||
|
||||
function! lightline#statusline(inactive)
|
||||
let [_, c, f, l, r] = [ '%{lightline#link()}', s:lightline.component, s:lightline.component_function, s:lightline.llen, s:lightline.rlen ]
|
||||
let mode = a:inactive ? 'inactive' : 'active'
|
||||
|
||||
Reference in New Issue
Block a user