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

Add option to skip file-type specific colors #119

Closed
wants to merge 3 commits into from
Closed

Add option to skip file-type specific colors #119

wants to merge 3 commits into from

Conversation

DarkWiiPlayer
Copy link

This is an attempt to fix #65 (or at least offer a workaround) for people who often switch between color schemes and don't want to use an additional plugin to manage them. It does nothing by default and needs to be specifically activated by setting g:only_generic_hl before activating the colorscheme (for example in the users vimrc)

When turned on, this should fix the problem with the color scheme
pollitung filetype-specific highlight groups that are by default linked
to more generic groups at the cost of disabling all filetype-specific
colouring from the theme.

It can be switched on by setting g:only_generic_hl to a truthy value
before loading the colourscheme.

When turned on, this should fix the problem with the color scheme
pollitung filetype-specific highlight groups that are by default linked
to more generic groups at the cost of disabling all filetype-specific
colouring from the theme.

It can be switched on by setting g:only_generic_hl to a truthy value
before loading the colourscheme.
@DarkWiiPlayer
Copy link
Author

aaaaah, I am dumb, I forgot to check exists(g:only_generic_hl)

The colorscheme (obviously) needs to check if the variable even exists
before checking if it's truthy :|
@NLKNguyen
Copy link
Owner

There are so many diff lines in the PR. Probably caused by your auto indentation, but still, it's hard to see the actual changes that way. Please limit to only the necessary lines to change.

@pickfire
Copy link

pickfire commented Aug 4, 2018

@NLKNguyen Try git diff --word-diff, it might help.

@DarkWiiPlayer
Copy link
Author

DarkWiiPlayer commented Aug 8, 2018

@pickfire @NLKNguyen That's actually not even necessary; you can view the word diff within github

The last fix was still flawed, in that it required the variable to be
set (to 0) in order to execute the filetype-specific colors block.
This version is tested to work with
- Undefined variable (use colors)
- Variable defined to 0 (use colors)
- Variable defined to non-0 (don't use colors)
exec 'hi pythonBuiltinFunc' . s:fg_foreground
exec 'hi pythonBuiltinObj' . s:fg_foreground
endif
if !exists('g:only_generic_hl') || !g:only_generic_hl
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable has to be specifically set before using the colorscheme or it will do nothing. This behavior secures that nothing will change for users who don't specifically want it to.

@NLKNguyen
Copy link
Owner

The whole PR still looks like 800+ lines changes and only the last commit of the sequence has little change. I'm not sure the effect of pulling in. Please make another PR that only has a few lines changed. Thanks!

@NLKNguyen NLKNguyen closed this Sep 4, 2018
@DarkWiiPlayer
Copy link
Author

I will do that then, but since it's basically surrounding a few hundred lines with an if statement, if I don't indent it all the file will look weird, so you'd then have to fix that yourself later on.

@NLKNguyen
Copy link
Owner

Yes, I will reindent or find a workaround. I wish the diff can show only the indentation added and not the whole line changed. It helps my review if the diff is small. Thanks!

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.

Enabling causes syntax highlighting to break for other color themes
3 participants