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

fix: starts_with_ansi always returned 1 and had inverted logic #422

Merged
merged 3 commits into from
Oct 21, 2021

Conversation

rwe
Copy link
Contributor

@rwe rwe commented Oct 21, 2021

$ansi_color_regex is defined as (…)? and so /^$ansi_color_regex/ will always match. This PR factors the ANSI-sequence part of the regex itself and checks (non-optionally) against that.

Additionally, the logic checking starts_with_ansi was inverted, likely to compensate for the above error, but as a side effect forcing diff-so-fancy always to color lines unnecessarily.

@scottchiefbaker scottchiefbaker merged commit c3205c8 into so-fancy:master Oct 21, 2021
@scottchiefbaker
Copy link
Contributor

Interesting... good catch!

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.

None yet

2 participants