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: index out of bounds when blaming a file ending with a blank line #2133

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

tdtrung17693
Copy link
Contributor

This Pull Request fixes/closes #2130.

It changes the following:

  • Fix index out-of-bound error when blaming a file ending with a blank line

More details:

The highlighting procedure works on a single line. It called str::lines to split the code into lines. The str::lines used split_inclusive internally, which omits the ending blank line (rust-lang/rust#111457). So, to overcome that, I added a blank line to the unstyled blame text.

I followed the checklist:

  • I added unittests
  • I ran make check without errors
  • I tested the overall application
  • I added an appropriate item to the changelog

@tdtrung17693 tdtrung17693 changed the title fix: index out of bounds when blaming a file ending with a blank line… fix: index out of bounds when blaming a file ending with a blank line Mar 17, 2024
@extrawurst extrawurst merged commit 99b9a38 into extrawurst:master Mar 20, 2024
18 checks passed
@extrawurst
Copy link
Owner

thanks for looking into 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.

Index out of bounds error in src/popups/blame_file.rs, line: 622, col: 38
2 participants