goyo.vim icon indicating copy to clipboard operation
goyo.vim copied to clipboard

Artifacts in Neovim

Open gleachkr opened this issue 9 years ago • 7 comments

Maybe this should be regarded as more of a neovim issue, but Goyo seems not to conceal everything that it is intended to when run in neovim. I've attached a screenshot:

screen shot 2015-06-07 at 10 18 25 pm

gleachkr avatar Jun 07 '15 21:06 gleachkr

Possibly related to their addition of EndOfBuffer highlight group I guess. But I can't reproduce the problem maybe because I don't have the latest version of nvim. I'll look into it when I get some time.

junegunn avatar Jun 08 '15 02:06 junegunn

Calling the following function helps, somewhat:

function! GoyoNeovim()
    let s:guibg = synIDattr(synIDtrans(hlID("Normal")), "bg", "gui")
    execute("hi NonText guifg=" . s:guibg)
    execute("hi StatusLine guifg=" . s:guibg)
    execute("hi StatusLineNC guifg=" . s:guibg)
endfunction

In a GUI for neovim (e.g. neovim.app), it solves the problem. In the terminal (with truecolor), it gets the tildes and other characters very close to the background, but doesn't achieve a perfect match.

Something which may be related to this issue is that it appears that in neovim, synIDattr behaves as if it is in a terminal (even when called in an attached GUI), but neovim renders everything according to guifg and guibg when truecolor is on.

gleachkr avatar Jul 13 '15 20:07 gleachkr

I'm using neovim with true color in urxvt and fixed this issue by adding this line to my goyo_enter function.

highlight NonText guifg=#181818 guibg=#181818

#181818 is my vim background color, I tried using bg or 0 and it didn't work. Try adding this line and setting it to the hex value of your background.

dylanaraps avatar Aug 07 '15 08:08 dylanaraps

I also get artifacts. Sadly @dylanaraps fix didn't work for me. Here is two screenshots to compare, the first one is Vim 7.4.2247 with 256 colors enabled, the second is NeoVim 0.1.5 with true colors enabled. In both I'm using deep-space.vim but making the background transparent in my .vimrc:

screenshot from 2016-08-28 23-27-00

screenshot from 2016-08-28 23-26-37

I'm on xfce4-terminal 0.6.90.

oblitum avatar Aug 29 '16 02:08 oblitum

I've fixed all artifacts for a transparent background through:

function! s:goyo_enter()
        " Remove artifacts for NeoVim on true colors transparent background.
        " guifg is the terminal's background color.
        hi! VertSplit gui=NONE guifg=#1b202a guibg=NONE
        hi! StatusLine gui=NONE guifg=#1b202a guibg=NONE
        hi! StatusLineNC gui=NONE guifg=#1b202a guibg=NONE
endfunction

screenshot from 2016-09-30 13-39-29

If one wants to remove the tildes, one could do hi! EndOfBuffer gui=NONE guifg=#1b202a guibg=NONE.

More info at https://github.com/neovim/neovim/issues/5408.

oblitum avatar Sep 29 '16 21:09 oblitum

synIDattr behaves as if it is in a terminal (even when called in an attached GUI),

For reference, that was fixed in https://github.com/neovim/neovim/pull/4851.

justinmk avatar Sep 29 '16 22:09 justinmk

I'm getting these artifacts on vim 7.4 patches 1-1952

knubie avatar Nov 09 '16 15:11 knubie