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

Skip reserved characters when representing lines as characters in diff_linemode #8

Merged
merged 1 commit into from
Apr 21, 2021

Conversation

eshurakov
Copy link
Contributor

In Rust char represents a unicode scalar, which can be any unicode code point, except code points reserved for surrogates (http://www.unicode.org/glossary/#unicode_scalar_value).

Trying to create a char from a code point in reserved range results in an error. Currently the code ignores the error and skips the character, which can result in wrong diffs for texts with large number of lines.

In this PR I'm skipping the reserved code points range when representing lines as characters in diff_lines_tochars_munge.

@ajitk
Copy link
Contributor

ajitk commented Apr 21, 2021

Looks great, thanks!

@ajitk ajitk merged commit be8f3ea into distill-io:master Apr 21, 2021
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