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

Initial support for termguicolors #31

Closed
wants to merge 1 commit into from

Conversation

maxwell-k
Copy link

termguicolors is a new option in vim 8 which allows vim to display 24 bit colours in ISO-8613-3 compatible terminals like xterm or hterm

This commit starts to address #26

@lilydjwg
Copy link
Owner

This doesn't work for older Vim which don't have this option.
The logic setting highlight colors needs to be changed too.

@maxwell-k
Copy link
Author

What is the earliest version that you support? 7.0? I will try to test and resolve.

Which logic do you mean?
Are you sure? I have tested this change on 8.0.1359 and it works IME

@lilydjwg
Copy link
Owner

lilydjwg commented May 15, 2018

When highlighting, colorizer checks t_Co first, and if it's 256, use cterm things. It should treat Vim with true color support on as GUI. Code is here: https://github.com/lilydjwg/colorizer/blob/master/autoload/colorizer.vim#L91

True color support is quite recent, so better check if the option really exists (especially that part of code runs even you don't use the plugin). E.g. CentOS still has 7.4.

@maxwell-k
Copy link
Author

OK perfect I will add logic to check that the option exists and test on 7.4.

A few lines down the GUI colors are always set (via guifg and guibg). These are what vim uses if termguicolors is set, so the logic you mention doesn't have any effect, IIUC.
https://github.com/lilydjwg/colorizer/blob/master/autoload/colorizer.vim#L95

I have tested with t_Co=8 which is the default and t_Co=256 on version 8.0.1359. I will add the logic to check the option exists, test on 7.4 and update the PR.

@lilydjwg
Copy link
Owner

Oh yes, guifg and guibg are always set, which is good. Maybe we should skip cterm part if termguicolors is set?

@maxwell-k maxwell-k closed this Apr 9, 2019
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.

2 participants