mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-11 13:03:50 -05:00
stop listening CursorMoved, BufUnload and remove lightline#update_once
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: 2020/01/27 19:41:58.
|
" Last Change: 2020/01/29 21:00:00.
|
||||||
" =============================================================================
|
" =============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
@@ -24,16 +24,9 @@ function! lightline#update() abort
|
|||||||
let s = winnr('$') == 1 && w > 0 ? [lightline#statusline(0)] : [lightline#statusline(0), lightline#statusline(1)]
|
let s = winnr('$') == 1 && w > 0 ? [lightline#statusline(0)] : [lightline#statusline(0), lightline#statusline(1)]
|
||||||
for n in range(1, winnr('$'))
|
for n in range(1, winnr('$'))
|
||||||
call setwinvar(n, '&statusline', s[n!=w])
|
call setwinvar(n, '&statusline', s[n!=w])
|
||||||
call setwinvar(n, 'lightline', n!=w)
|
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! lightline#update_once() abort
|
|
||||||
if !exists('w:lightline') || w:lightline
|
|
||||||
call lightline#update()
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! lightline#update_disable() abort
|
function! lightline#update_disable() abort
|
||||||
if !s:lightline.enable.statusline
|
if !s:lightline.enable.statusline
|
||||||
return
|
return
|
||||||
@@ -53,7 +46,6 @@ function! lightline#enable() abort
|
|||||||
autocmd SessionLoadPost * call lightline#highlight()
|
autocmd SessionLoadPost * call lightline#highlight()
|
||||||
autocmd ColorScheme * if !has('vim_starting') || expand('<amatch>') !=# 'macvim'
|
autocmd ColorScheme * if !has('vim_starting') || expand('<amatch>') !=# 'macvim'
|
||||||
\ | call lightline#update() | call lightline#highlight() | endif
|
\ | call lightline#update() | call lightline#highlight() | endif
|
||||||
autocmd CursorMoved,BufUnload * call lightline#update_once()
|
|
||||||
augroup END
|
augroup END
|
||||||
augroup lightline-disable
|
augroup lightline-disable
|
||||||
autocmd!
|
autocmd!
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
" Filename: plugin/lightline.vim
|
" Filename: plugin/lightline.vim
|
||||||
" Author: itchyny
|
" Author: itchyny
|
||||||
" License: MIT License
|
" License: MIT License
|
||||||
" Last Change: 2019/07/30 12:00:00.
|
" Last Change: 2020/01/29 21:00:00.
|
||||||
" =============================================================================
|
" =============================================================================
|
||||||
|
|
||||||
if exists('g:loaded_lightline') || v:version < 700
|
if exists('g:loaded_lightline') || v:version < 700
|
||||||
@@ -22,7 +22,6 @@ augroup lightline
|
|||||||
autocmd SessionLoadPost * call lightline#highlight()
|
autocmd SessionLoadPost * call lightline#highlight()
|
||||||
autocmd ColorScheme * if !has('vim_starting') || expand('<amatch>') !=# 'macvim'
|
autocmd ColorScheme * if !has('vim_starting') || expand('<amatch>') !=# 'macvim'
|
||||||
\ | call lightline#update() | call lightline#highlight() | endif
|
\ | call lightline#update() | call lightline#highlight() | endif
|
||||||
autocmd CursorMoved,BufUnload * call lightline#update_once()
|
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" This quickfix option was introduced at Vim 85850f3a5ef9, which is the commit
|
" This quickfix option was introduced at Vim 85850f3a5ef9, which is the commit
|
||||||
|
|||||||
Reference in New Issue
Block a user