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

The order of colors and a bug with a comma #31

Closed
john-cj opened this issue Mar 6, 2021 · 5 comments
Closed

The order of colors and a bug with a comma #31

john-cj opened this issue Mar 6, 2021 · 5 comments
Labels

Comments

@john-cj
Copy link

john-cj commented Mar 6, 2021

It seems to me that the order of colors is somewhat random. I don't know is it a bug or by intent, but I would prefer a more predictable order. For example: red, green, blue, violet, red, green, blue, violet, red, green, blue, violet, and so on.

image

Also, it seems there is a bug with a comma: notice that a comma before 8, 11, 18, and 21 should be white.

Tested with Mariana default color scheme.

@mechatroner mechatroner added the bug label Mar 7, 2021
@mechatroner
Copy link
Owner

Thanks for spotting this bug, @john-cj ! I know what the root cause is, and trying to find how to fix it with minimal fallout (basically the scope names for columns 10 * n + 1 and 10 * n + 8 don't exist in the default color scheme, this causes it to fall back to the default color, but the matching rules made in a way that the previous group also captures the separator, and if the next group has a scope color defined it overwrites the previous scope color, but otherwise the separators remains colored by the previous group color)
You can actually fix the bug and have nice your own nice custom colors by setting use_custom_rainbow_colors and optionally auto_adjust_rainbow_colors. If you just set use_custom_rainbow_colors you should theoretically be able to customize the colors as you like, see the README file. You can use this file as a template for your own custom colors: https://github.com/mechatroner/sublime_rainbow_csv/blob/master/RainbowCSV.sublime-color-scheme

@john-cj
Copy link
Author

john-cj commented Mar 13, 2021

Thanks, I will look it today.

@mechatroner
Copy link
Owner

One solution is to replace meta_scope with meta_content_scope in all syntax rules - this will group columns with trailing separators instead of preceding (just like in VSCode version) - but in that case, the internal python offset calculation logic will have to be adjusted too. Just thinking out loud.

mechatroner pushed a commit that referenced this issue Mar 21, 2021
…separator-column grouping and fix the wrong separator color bug
@mechatroner
Copy link
Owner

I just released version 2.4.0 that should fix the comma bug.

@Huntk23
Copy link

Huntk23 commented Apr 6, 2022

@mechatroner

Using 2.7.0 - I still seem to have a similar issue:

image

I've also attempted to use use_custom_rainbow_colors but not quite understanding the rules.

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

No branches or pull requests

3 participants