From 53176a0b75d6389d775d7bce0d494e58fc654f38 Mon Sep 17 00:00:00 2001 From: itchyny Date: Thu, 5 Nov 2020 20:07:44 +0900 Subject: [PATCH] drop support of Vim 7.2 --- autoload/lightline.vim | 18 +++--------------- plugin/lightline.vim | 4 ++-- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/autoload/lightline.vim b/autoload/lightline.vim index 4fa773b..6ffbb42 100644 --- a/autoload/lightline.vim +++ b/autoload/lightline.vim @@ -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])) diff --git a/plugin/lightline.vim b/plugin/lightline.vim index a11d662..e1254b7 100644 --- a/plugin/lightline.vim +++ b/plugin/lightline.vim @@ -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