-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Remove false positive line trimming
Previously, it was possible for a `...` to be inserted when no trimming was actually done. For example: ``` | 1 | version = "0.1.0" 2 | # Ensure that the spans from toml handle utf-8 correctly 3 | authors = [ | ___________^ 4 | | { name = "Z...ALGO", email = 1 } 5 | | ] | |_^ RUF200 | ``` After this fix, the `...` is no longer inserted: ``` | 1 | version = "0.1.0" 2 | # Ensure that the spans from toml handle utf-8 correctly 3 | authors = [ | ___________^ 4 | | { name = "ZALGO", email = 1 } 5 | | ] | |_^ RUF200 | ``` This is another low confidence fix where I'm not sure that it's right. But the implementation was previously seeming to conflate the line length (in bytes) versus the actual rendered length. So instead of trying to do some math to figure out whether an ellipsis should be inserted, we just keep track of whether the code line we write was truncated or not.
- Loading branch information
1 parent
7132bf3
commit 694d299
Showing
3 changed files
with
47 additions
and
29 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