From da5a84c77fdc0eb6dd06351fd4fb183411b6f9b9 Mon Sep 17 00:00:00 2001 From: itchyny Date: Fri, 19 Jun 2020 07:03:42 +0900 Subject: [PATCH] skip updating statusline for autocmd window (close #444, #447, #448) --- autoload/lightline.vim | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/autoload/lightline.vim b/autoload/lightline.vim index 0e5d401..b4b1665 100644 --- a/autoload/lightline.vim +++ b/autoload/lightline.vim @@ -2,7 +2,7 @@ " Filename: autoload/lightline.vim " Author: itchyny " License: MIT License -" Last Change: 2020/03/16 19:10:15. +" Last Change: 2020/06/19 07:02:24. " ============================================================================= let s:save_cpo = &cpo @@ -11,7 +11,7 @@ set cpo&vim let s:_ = 1 " 1: uninitialized, 2: disabled function! lightline#update() abort - if &buftype ==# 'popup' | return | endif + if s:skip() | return | endif if s:_ if s:_ == 2 | return | endif call lightline#init() @@ -27,6 +27,16 @@ function! lightline#update() abort endfor endfunction +if exists('*win_gettype') + function! s:skip() abort " Vim 8.2.0257 (00f3b4e007), 8.2.0991 (0fe937fd86), 8.2.0996 (40a019f157) + return win_gettype() ==# 'popup' || win_gettype() ==# 'autocmd' + endfunction +else + function! s:skip() abort + return &buftype ==# 'popup' + endfunction +endif + function! lightline#update_disable() abort if !s:lightline.enable.statusline return