junegunn / goyo.vim

:tulip: Distraction-free writing in Vim
MIT License
4.52k stars 116 forks source link

Returning from Goyo changes background=dark to background=light #78

Closed jhrmnn closed 8 years ago

jhrmnn commented 9 years ago

What the title says. Does it make sense or is it some plugin collision? As a workaround, I have

autocmd! User GoyoLeave
autocmd  User GoyoLeave nested set background=dark
junegunn commented 9 years ago

Check :verbose set background.

whoizit commented 9 years ago

no :set background? showing same, but something wrong

  1. open file: http://rghost.ru/68nM9jpw5.view
  2. :Goyo http://rghost.ru/8Wf7rr7YG.view
  3. :Goyo http://rghost.ru/7867VmmHP.view
jhrmnn commented 8 years ago

After entering Goyo, :verbose set background? says background=dark, last set from ~/.vimrc. After leaving Goyo, it says background=light, last set from MacVim.app/Contents/Resources/vim/runtime/colors/default.vim. So is it the case that Goyo does not restore the previous state but rather loads a default one? I guess there is no general solution to this problem.

junegunn commented 8 years ago

Goyo reloads the current color scheme on exit. That's all. You'll see that background becomes light if you :colo default even without Goyo. If you don't like it, use the workaround provided by @azag0 or choose a color scheme that does keep the option value intact. My seoul256 is one example.

jhrmnn commented 8 years ago

I actually don't use any color scheme, that is I use the default one and set background=dark manually in .vimrc, which is what is recommended in :h 'background'. But I see there is no way for Goyo to know that so I'll be using the GoyoLeave construct.