mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-17 16:03:41 -05:00
drop support of Vim 7.2
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
" Filename: autoload/lightline.vim
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2020/09/25 10:56:16.
|
||||
" Last Change: 2020/11/05 20:04:51.
|
||||
" =============================================================================
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
@@ -339,7 +339,7 @@ function! s:convert(name, index) abort
|
||||
if has_key(s:lightline.component_expand, a:name)
|
||||
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(s:map(s:evaluate_expand(s:lightline.component_expand[a:name]),
|
||||
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] != []')
|
||||
else
|
||||
return [[[a:name], 0, a:index, a:index]]
|
||||
@@ -356,25 +356,13 @@ function! s:flatten_twice(xss) abort
|
||||
return ys
|
||||
endfunction
|
||||
|
||||
if v:version > 702 || v:version == 702 && has('patch295')
|
||||
let s:map = function('map')
|
||||
else
|
||||
function! s:map(xs, f) abort
|
||||
let ys = []
|
||||
for i in range(len(a:xs))
|
||||
call extend(ys, map(a:xs[(i):(i)], substitute(a:f, 'v:key', i, 'g')))
|
||||
endfor
|
||||
return ys
|
||||
endfunction
|
||||
endif
|
||||
|
||||
function! s:expand(components) abort
|
||||
let components = []
|
||||
let expanded = []
|
||||
let indices = []
|
||||
let prevtype = ''
|
||||
let previndex = -1
|
||||
let xs = s:flatten_twice(s:map(deepcopy(a:components), 'map(v:val, "s:convert(v:val, ''" . v:key . "'')")'))
|
||||
let xs = s:flatten_twice(map(deepcopy(a:components), 'map(v:val, "s:convert(v:val, ''" . v:key . "'')")'))
|
||||
for [component, expand, type, index] in xs
|
||||
if prevtype !=# type
|
||||
for i in range(previndex + 1, max([previndex, index - 1]))
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
" Filename: plugin/lightline.vim
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2020/03/16 19:08:41.
|
||||
" Last Change: 2020/11/05 20:05:40.
|
||||
" =============================================================================
|
||||
|
||||
if exists('g:loaded_lightline') || v:version < 700
|
||||
if exists('g:loaded_lightline') || v:version < 703
|
||||
finish
|
||||
endif
|
||||
let g:loaded_lightline = 1
|
||||
|
||||
Reference in New Issue
Block a user