-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: different approach to fix off-by-one without affecting display
This approach removes the additional empty line that would cause the display logic to disagree in line count. The major difference is that this new approach does not change the output of the display implementation, therefore, no test files need to be updated, and no additional line is printed to the end-user. As for the cause of the index out-of-bounds, this is simply a disagreement between line sources, such as the `line-numbers` crate and Tree Sitter, which all reports the correct number of lines, with the `str::lines` iterator which does not iterate over the last new line character if the last line is empty.
- Loading branch information
1 parent
27f9e87
commit 017381e
Showing
5 changed files
with
36 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters