mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-13 22:13:50 -05:00
cache tabline (close #48)
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
" Version: 0.0
|
" Version: 0.0
|
||||||
" Author: itchyny
|
" Author: itchyny
|
||||||
" License: MIT License
|
" License: MIT License
|
||||||
" Last Change: 2013/11/15 12:30:33.
|
" Last Change: 2013/11/29 12:48:45.
|
||||||
" =============================================================================
|
" =============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
@@ -320,9 +320,11 @@ function! s:line(tabline, inactive)
|
|||||||
return _
|
return _
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
let [s:tabnrs, s:tabnr, s:tabline] = [-1, -1, '']
|
||||||
function! lightline#tabline()
|
function! lightline#tabline()
|
||||||
if !has_key(s:highlight, 'tabline') | call lightline#highlight('tabline') | endif
|
if !has_key(s:highlight, 'tabline') | call lightline#highlight('tabline') | endif
|
||||||
return s:line(1, 0)
|
if [s:tabnrs, s:tabnr] != [tabpagenr('$'), tabpagenr()] | let [s:tabnrs, s:tabnr, s:tabline] = [tabpagenr('$'), tabpagenr(), s:line(1, 0)] | endif
|
||||||
|
return s:tabline
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! lightline#tabs()
|
function! lightline#tabs()
|
||||||
|
|||||||
Reference in New Issue
Block a user