junegunn / goyo.vim

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

Conflict with CursorLine highlight group on Neovim #253

Closed pesader closed 3 years ago

pesader commented 3 years ago

asciicast

As you can see in the screencast above, setting the CursorLine highlight group to a color different than the background's results in some artifacts when entering the Goyo buffer. Is there a workaround to fix this other than changing the CursorLine highlight?

Thanks for developing this awesome plugin! It makes Vim/Neovim much more comfortable for non-programming writing.

junegunn commented 3 years ago

I can't reproduce the problem. See if you still have the issue with a minimal configuration file like so

set nocompatible hidden laststatus=2 cursorline
hi Cursorline ctermbg=red guibg=red

if !filereadable('/tmp/plug.vim')
  silent !curl --insecure -fLo /tmp/plug.vim
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif

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

autocmd VimEnter * PlugClean! | PlugUpdate --sync
pesader commented 3 years ago

Thanks for the quick reply!

I can't reproduce it either when using this minimal config, so must be a problem on my end. Would you leave this issue open until I figure out what's causing this, so I can publish it here in case another person faces the same problem?

pesader commented 3 years ago

Found the culprit: I like to use the cursor line highlight to differentiate between insert and normal mode, instead of status line. So I had this in my config file.

autocmd cur BufEnter * silent set cul " <-- the culprit
autocmd cur InsertEnter * silent set nocul
autocmd cur InsertLeave * silent set cul

Changing that line to:

autocmd cur VimEnter * silent set cul

Solved the problem. Thank you for your time!