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 split_at (decrease index) #456

Merged
merged 5 commits into from Jan 12, 2023
Merged

Fix split_at (decrease index) #456

merged 5 commits into from Jan 12, 2023

Conversation

kyoheiu
Copy link
Contributor

@kyoheiu kyoheiu commented Nov 3, 2022

Fixed #453

See also another PR #455 .

This PR fixes split_at, which can panic when splitting occurs inside the middle of a wide character, to decrese index to avoid panic (In this version, split_at returns the same type as before).
Also includes rust-analyzer's formatting.

Test results:
commit 8678b7c

failures:
    highlighting::highlighter::tests::can_parse
    highlighting::highlighter::tests::can_parse_with_highlight_state_from_cache
    highlighting::highlighter::tests::test_ranges
    highlighting::theme_set::tests::can_parse_common_themes
    html::tests::strings
    html::tests::tricky_test_syntax
    parsing::parser::tests::can_compare_parse_states
    parsing::parser::tests::can_parse_backrefs
    parsing::parser::tests::can_parse_includes
    parsing::parser::tests::can_parse_issue25
    parsing::parser::tests::can_parse_preprocessor_rules
    parsing::parser::tests::can_parse_simple
    parsing::parser::tests::can_parse_yaml
    parsing::syntax_set::tests::can_load

test result: FAILED. 86 passed; 14 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.11s

fix-split_at-change-index

failures:
    highlighting::highlighter::tests::can_parse
    highlighting::highlighter::tests::can_parse_with_highlight_state_from_cache
    highlighting::highlighter::tests::test_ranges
    highlighting::theme_set::tests::can_parse_common_themes
    html::tests::strings
    html::tests::tricky_test_syntax
    parsing::parser::tests::can_compare_parse_states
    parsing::parser::tests::can_parse_backrefs
    parsing::parser::tests::can_parse_includes
    parsing::parser::tests::can_parse_issue25
    parsing::parser::tests::can_parse_preprocessor_rules
    parsing::parser::tests::can_parse_simple
    parsing::parser::tests::can_parse_yaml
    parsing::syntax_set::tests::can_load

test result: FAILED. 86 passed; 14 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.00s

Nothing changed.

Copy link
Owner

@trishume trishume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll use this version so it doesn't require a major version bump. Thanks and sorry it took so long for me to get around to this!

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.

util::split_at panics with multibyte characters
2 participants