junegunn / goyo.vim

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

Random '.' at the bottom right corner of Goyo mode #59

Closed scwood closed 9 years ago

scwood commented 9 years ago

screen shot 2015-02-21 at 2 39 56 am

I have this really annoying period character in the bottom right of my screen... I'm sure it's something on my end. Do you have any idea how I could troubleshoot this?

Only shows up in Goyo, here's my vimrc, if that helps.

junegunn commented 9 years ago

Well, I don't know, there's really no shortcut. Disable everything and start with the minimum,

call plug#begin()
Plug 'junegunn/goyo.vim'
call plug#end()

and incrementally reenable stuff until you find the culprit.

junegunn commented 9 years ago

What does :verbose hi statusline say?

scwood commented 9 years ago

screen shot 2015-02-21 at 11 04 33 am

I'll move to a minimal vimrc and try to replicate it.

scwood commented 9 years ago

screen shot 2015-02-21 at 11 08 13 am

With that minimal .vimrc it's still showing. Deleted .vim folder and reinstalled the plugin. I'm not in tmux or anything... super weird.

Edit: doing it in both the default terminal and iterm2

junegunn commented 9 years ago

Vim version?

scwood commented 9 years ago

7.4 compiled with homebrew.

junegunn commented 9 years ago

Ah, yes it's reproducible, and I completely forgot about this.

Goyo tries to hide the dot in the statusline by setting the color of it to the same color as the background. However, if your plugin does not explicitly set background color (echo synIDattr(synIDtrans(hlID('Normal')), 'bg') returns -1 or empty string), Goyo cannot do so and simply sets the color to g:goyo_bg (undocumented) or black. See here: https://github.com/junegunn/goyo.vim/blob/master/autoload/goyo.vim#L109-L112

The workaround is to use a color scheme that sets that background color for Normal highlight group, or you set it yourself.

scwood commented 9 years ago

What would be the syntax for setting the background color for the normal highlight group? Is it something I could just add to my colorscheme or my vimrc?

junegunn commented 9 years ago

Since you're using terminal

highlight Normal ctermbg=ANSICOLORCODE

should do. I recommend putting it in your color scheme.

scwood commented 9 years ago

So with that snippet, it still doesn't seem to be changing to the background color chosen?

Just to get it going I threw it in my .vimrc and picked a random color and the period is still showing up in a different color:

screen shot 2015-02-21 at 12 09 31 pm

junegunn commented 9 years ago

What if you put it in your color scheme?

scwood commented 9 years ago

screen shot 2015-02-21 at 12 14 12 pm

233 is the correct color. Still there after quitting and reloading. Does it matter where I stick it in the colorscheme?

junegunn commented 9 years ago

Hmm, not sure. Could you test with another color scheme, such as junegunn/seoul256.vim?

junegunn commented 9 years ago

And please check the output of :echo synIDattr(synIDtrans(hlID('Normal')), 'bg')

scwood commented 9 years ago

Echo output is in the left corner. screen shot 2015-02-21 at 12 26 58 pm

junegunn commented 9 years ago

Huh, very strange. It's not reproducible on my terminal.

vim -Nu <(cat << EOF
call plug#begin()
Plug 'junegunn/goyo.vim'
Plug 'junegunn/seoul256.vim'
call plug#end()
colo seoul256
EOF
)

Still reproducible with the above? What does :hi statusline say?

scwood commented 9 years ago

Still there... :( screen shot 2015-02-21 at 12 35 34 pm

junegunn commented 9 years ago

You see, ctermfg == ctermbg, so the text shouldn't be visible. And the tildes (~) on the buffer should be invisible as well (:hi nontext), but they're showing for some unknown reason. Are you still testing it on both iterm2 and terminal.app?

scwood commented 9 years ago

There's the nontext. Terminal.app is working correctly now, so I guess it's an iterm issue?

screen shot 2015-02-21 at 12 43 53 pm

scwood commented 9 years ago

Turning down the contrast slider all the way on my iterm2 settings seemed to fix it. I feel like an idiot. Thanks for your help! screen shot 2015-02-21 at 12 48 08 pm

junegunn commented 9 years ago

Ha, no problem.