mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-16 15:33:49 -05:00
Compare commits
3 Commits
58c97bc21c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e358557e1a | ||
|
|
d6a07ea376 | ||
|
|
7e3f26781f |
@@ -2,7 +2,7 @@
|
||||
" Filename: autoload/lightline.vim
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2021/11/21 22:54:46.
|
||||
" Last Change: 2024/12/30 21:33:02.
|
||||
" =============================================================================
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
@@ -317,26 +317,13 @@ function! lightline#statusline(inactive) abort
|
||||
return s:line(0, a:inactive)
|
||||
endfunction
|
||||
|
||||
function! s:normalize(result) abort
|
||||
if type(a:result) == 3
|
||||
return map(a:result, 'type(v:val) == 1 ? v:val : string(v:val)')
|
||||
elseif type(a:result) == 1
|
||||
return [a:result]
|
||||
else
|
||||
return [string(a:result)]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:evaluate_expand(component) abort
|
||||
try
|
||||
let result = eval(a:component . '()')
|
||||
if type(result) == 1 && result ==# ''
|
||||
return []
|
||||
endif
|
||||
catch
|
||||
return []
|
||||
endtry
|
||||
return map(type(result) == 3 ? (result + [[], [], []])[:2] : [[], [result], []], 'filter(s:normalize(v:val), "v:val !=# ''''")')
|
||||
try | let value = eval(a:component . '()') | catch | return [] | endtry
|
||||
return value is '' ? [] :
|
||||
\ map(type(value) == 3 ? value : [[], [value], []],
|
||||
\ 'filter(map(type(v:val) == 3 ? v:val : [v:val],
|
||||
\ "type(v:val) == 1 ? v:val : string(v:val)"),
|
||||
\ "v:val !=# ''''")')
|
||||
endfunction
|
||||
|
||||
function! s:convert(name, index) abort
|
||||
@@ -346,7 +333,8 @@ function! s:convert(name, index) abort
|
||||
let type = get(s:lightline.component_type, a:name, a:index)
|
||||
let is_raw = get(s:lightline.component_raw, a:name) || type ==# 'raw'
|
||||
return filter(map(s:evaluate_expand(s:lightline.component_expand[a:name]),
|
||||
\ '[v:val, 1 + ' . is_raw . ', v:key == 1 && ' . (type !=# 'raw') . ' ? "' . type . '" : "' . a:index . '", "' . a:index . '"]'), 'v:val[0] != []')
|
||||
\ '[v:val, 1 + ' . is_raw . ', v:key == 1 && ' . (type !=# 'raw') .
|
||||
\ ' ? "' . type . '" : "' . a:index . '", "' . a:index . '"]'), 'v:val[0] != []')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -963,8 +963,11 @@ Problem 6: *lightline-problem-6*
|
||||
How to use a powerline font and the triangles for separators.
|
||||
|
||||
Using a patched font is not recommended due to less
|
||||
portability. Also the powerline fonts project is not actively
|
||||
maintained (https://github.com/powerline/fonts).
|
||||
portability. Also the original powerline fonts project is
|
||||
not actively maintained (https://github.com/powerline/fonts).
|
||||
However, there are alternatives which offer both patching of
|
||||
local fonts as well as downloads of already patched fonts,
|
||||
e.g. Nerd Fonts (https://github.com/ryanoasis/nerd-fonts).
|
||||
|
||||
If you still want to use a patched font, you can configure
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user