stop listening CursorMoved, BufUnload and remove lightline#update_once

This commit is contained in:
itchyny
2020-01-29 21:26:55 +09:00
parent 96d3618f39
commit 468ca152fd
2 changed files with 2 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
" Filename: autoload/lightline.vim
" Author: itchyny
" License: MIT License
" Last Change: 2020/01/27 19:41:58.
" Last Change: 2020/01/29 21:00:00.
" =============================================================================
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)]
for n in range(1, winnr('$'))
call setwinvar(n, '&statusline', s[n!=w])
call setwinvar(n, 'lightline', n!=w)
endfor
endfunction
function! lightline#update_once() abort
if !exists('w:lightline') || w:lightline
call lightline#update()
endif
endfunction
function! lightline#update_disable() abort
if !s:lightline.enable.statusline
return
@@ -53,7 +46,6 @@ function! lightline#enable() abort
autocmd SessionLoadPost * call lightline#highlight()
autocmd ColorScheme * if !has('vim_starting') || expand('<amatch>') !=# 'macvim'
\ | call lightline#update() | call lightline#highlight() | endif
autocmd CursorMoved,BufUnload * call lightline#update_once()
augroup END
augroup lightline-disable
autocmd!

View File

@@ -2,7 +2,7 @@
" Filename: plugin/lightline.vim
" Author: itchyny
" 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
@@ -22,7 +22,6 @@ augroup lightline
autocmd SessionLoadPost * call lightline#highlight()
autocmd ColorScheme * if !has('vim_starting') || expand('<amatch>') !=# 'macvim'
\ | call lightline#update() | call lightline#highlight() | endif
autocmd CursorMoved,BufUnload * call lightline#update_once()
augroup END
" This quickfix option was introduced at Vim 85850f3a5ef9, which is the commit