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

Change the way syntax match is executed. #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

padawin
Copy link

@padawin padawin commented Oct 13, 2019

Problem: The syntax highlight group is defined based on the RGB code used, which causes problems if 2 colors use the same RGB (e.g. if you redefine xterm ANSI colors in .Xresources). It can create the following (Note the colors 16, 21 and 51):
Screenshot from 2019-10-13 20-00-10

It can be reproduced by modifying the ANSI colors of the terminal.

This PR makes the highlight independent from the rgb code used, as long as it is an RGB code.

Result afterwards:

Screenshot from 2019-10-13 20-09-17

If the match is executed based on the hard coded color (which should not
be hard coded in the first place, mentioned in issue guns#1), a color code
can have multiple matches if the hex code is used for multiple colors.

This commit changes the matching as: ' \d+ #[0-9af]+', containing the
xterm256 index of the color, so that the highlight class is independant
from the used RGB code.
padawin added a commit to padawin/xterm-color-table.vim that referenced this pull request Jan 6, 2022
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.

1 participant