Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible fix to #160 - Fix other side effects from resetting colorscheme #195

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TaDaa
Copy link

@TaDaa TaDaa commented Feb 23, 2019

Hi there -- this is an attempt to remove the colorscheme reset in goyo.vim, which should fix #160 . There are a number of side effects caused by resetting the colorscheme (reset of user highlights + incorrect highlights are sometimes reset)

I haven't tested this PR much other than just to verify that the basic functionality is working both within vim, neovim, gui, and terminal and that user highlights are no longer blown away.

The code could be cleaned up a bit - but wanted to see if there was any interest before moving any further with it.

@nathanshelly
Copy link

Would love to see this merged! (provided people who know more about vimscript than I do think it's a good idea)

Having the same highlighting issues mentioned in #160

@junegunn
Copy link
Owner

junegunn commented Apr 15, 2019

There are a number of side effects caused by resetting the colorscheme (reset of user highlights + incorrect highlights are sometimes reset)

I've answered this question several times in the past. The point is; you'll have the same issue without Goyo if you switch your color scheme. You will lose custom highlights whenever you run :colo some-other-colorscheme, even if you don't start Goyo. And you don't want that.

A definite, robust, and simpler (from Goyo's perspective) solution to the problem is to set up custom highlights on autocmd ColorScheme. See #84 (comment).

Making Goyo remembering and restoring the attributes of highlight groups should be more convenient for users who don't know the implications of setting custom highlights without autocmd, but it's still a partial fix to the problem and I didn't like the extra code I should maintain. See my previous comment here: #103 (comment)

Having said that, I'm not saying that Goyo shouldn't do this, just suggesting there's a better solution to the problem. I'll review and test the patch when I get a chance.

@holychowders
Copy link

Oh, I didn't see this PR.

I left a comment on #160. My "fix" was to just remove line 340, but I didn't have to replace it with anything (as is being done here). I don't know if that means anything to you.

Here's the comment: #160 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window colour affected when returning from distraction free mode
4 participants