mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-12 21:43:50 -05:00
do not sort in s:unique and rename it to s:uniq
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 21:29:36.
|
" Last Change: 2016/03/24 21:35:29.
|
||||||
" =============================================================================
|
" =============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
@@ -256,20 +256,18 @@ function! s:term(l) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if exists('*uniq')
|
if exists('*uniq')
|
||||||
function! s:unique(xs) abort
|
function! s:uniq(xs) abort
|
||||||
return uniq(sort(a:xs))
|
return uniq(a:xs)
|
||||||
endfunction
|
endfunction
|
||||||
else
|
else
|
||||||
function! s:unique(xs) abort
|
function! s:uniq(xs) abort
|
||||||
call sort(a:xs)
|
let i = len(a:xs) - 1
|
||||||
let i = 0
|
while 0 < i
|
||||||
let l = len(a:xs) - 1
|
if a:xs[i] ==# a:xs[i - 1]
|
||||||
while i < l
|
call remove(a:xs, i)
|
||||||
if a:xs[i] ==# a:xs[i + 1]
|
let i -= 2
|
||||||
call remove(a:xs, i + 1)
|
|
||||||
let l -= 1
|
|
||||||
else
|
else
|
||||||
let i += 1
|
let i -= 1
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
return a:xs
|
return a:xs
|
||||||
@@ -289,7 +287,7 @@ function! lightline#highlight(...) abort
|
|||||||
endif
|
endif
|
||||||
let [s:lightline.llen, s:lightline.rlen] = [len(c.normal.left), len(c.normal.right)]
|
let [s:lightline.llen, s:lightline.rlen] = [len(c.normal.left), len(c.normal.right)]
|
||||||
let [s:lightline.tab_llen, s:lightline.tab_rlen] = [len(has_key(c,'tabline') && has_key(c.tabline, 'left') ? c.tabline.left : c.normal.left), len(has_key(c,'tabline') && has_key(c.tabline, 'right') ? c.tabline.right : c.normal.right)]
|
let [s:lightline.tab_llen, s:lightline.tab_rlen] = [len(has_key(c,'tabline') && has_key(c.tabline, 'left') ? c.tabline.left : c.normal.left), len(has_key(c,'tabline') && has_key(c.tabline, 'right') ? c.tabline.right : c.normal.right)]
|
||||||
let h = s:unique(filter(values(g), 'v:val !=# "raw"'))
|
let h = s:uniq(sort(filter(values(g), 'v:val !=# "raw"')))
|
||||||
let modes = a:0 ? [a:1] : extend(['normal', 'insert', 'replace', 'visual', 'inactive', 'command', 'select', 'tabline'], has('nvim') ? ['terminal'] : [])
|
let modes = a:0 ? [a:1] : extend(['normal', 'insert', 'replace', 'visual', 'inactive', 'command', 'select', 'tabline'], has('nvim') ? ['terminal'] : [])
|
||||||
for mode in modes
|
for mode in modes
|
||||||
let s:highlight[mode] = 1
|
let s:highlight[mode] = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user