mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-14 22:43:50 -05:00
use uniq() function
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
" Filename: autoload/lightline.vim
|
" Filename: autoload/lightline.vim
|
||||||
" Author: itchyny
|
" Author: itchyny
|
||||||
" License: MIT License
|
" License: MIT License
|
||||||
" Last Change: 2016/03/24 20:58:46.
|
" Last Change: 2016/03/24 21:15:04.
|
||||||
" =============================================================================
|
" =============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
@@ -255,17 +255,8 @@ function! s:term(l) abort
|
|||||||
return len(a:l) == 5 && type(a:l[4]) == 1 && strlen(a:l[4]) ? 'term='.a:l[4].' cterm='.a:l[4].' gui='.a:l[4] : ''
|
return len(a:l) == 5 && type(a:l[4]) == 1 && strlen(a:l[4]) ? 'term='.a:l[4].' cterm='.a:l[4].' gui='.a:l[4] : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:unique(l) abort
|
function! s:unique(xs) abort
|
||||||
let [l,i,s] = [a:l,0,{}]
|
return uniq(sort(copy(a:xs)))
|
||||||
while i < len(l)
|
|
||||||
let k = string(l[i])
|
|
||||||
if has_key(s, k)
|
|
||||||
call remove(l, i)
|
|
||||||
else
|
|
||||||
let [s[k],i] = [1,i+1]
|
|
||||||
endif
|
|
||||||
endwhile
|
|
||||||
return l
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! lightline#highlight(...) abort
|
function! lightline#highlight(...) abort
|
||||||
|
|||||||
Reference in New Issue
Block a user