Closed obxhdx closed 10 years ago
Goyo automatically disables lightline as you see at https://github.com/junegunn/goyo.vim/blob/master/plugin/goyo.vim#L177
Thanks for pointing out that line in Goyo. But like I said, after disabled, Lightline was reappearing after some time.
Anyways, I just found out what the problem really was... I had the following configuration:
autocmd CursorHold,BufWritePost,InsertLeave * call s:component_expand()
function! s:component_expand()
call TrailingSpaceWarning()
call MixedIndentSpaceWarning()
call lightline#update()
endfunction
So, that CursorHold was the issue.
You call lightline#update
so the statusline is updated. CursorHold
is triggered even when you use Goyo or anything.
You can modify your autocmd
to update lightline.vim only when it's enabled.
autocmd CursorHold,BufWritePost,InsertLeave * call s:component_expand()
function! s:component_expand()
call TrailingSpaceWarning()
call MixedIndentSpaceWarning()
if exists('#lightline')
call lightline#update()
endif
endfunction
I have Goyo.vim installed, which provides a distraction-free mode.
I want to temporarily disable Lightline when Goyo gets enabled, just like Goyo already does for some other plugins: https://github.com/junegunn/goyo.vim/blob/master/plugin/goyo.vim#L150.
I tried calling
lightline#disable()
but Lightline always comes back after a few seconds.