junegunn / goyo.vim

:tulip: Distraction-free writing in Vim
MIT License
4.49k stars 115 forks source link

Scratch window airline bars appear on FocusGained #198

Open syyyr opened 5 years ago

syyyr commented 5 years ago

Hello, I've encountered a problem with goyo and vim-airline. When I focus vim, scratch windows appear. image They disappear after I try to switch to them. This only happens after I type some text in the goyo mode (that is, it doesn't happen with a goyo "window", that hasn't been written to yet).

Airline sets some sort of a FocusGained autocmd:

autocmd FocusGained * unlet! w:airline_lastmode | :call <sid>airline_refresh()

I have already solved this problem by inserting this into my vimrc:

autocmd! User GoyoEnter nested set eventignore=FocusGained
autocmd! User GoyoLeave nested set eventignore=

this disables FocusGained in goyo mode and fixes this bug. Is this something that can be fixed with goyo? Or is this a problem with airline?

SwayamShree123 commented 2 years ago

@syyyr : I am having the same issue, but in my case the scratch windows appear the moment I toggle airline on in Goyo and the scratch windows do not disappear. Your solution also did not work for me. Any ideas?

syyyr commented 2 years ago

@SwayamShree123 I am not sure, I'm using neither Goyo nor Airline. I can understand my solution doesn't work for toggling Airline on in Goyo. I am not sure why you would even want that? AFAIK, Goyo should turn airline OFF, not ON.