You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 PR aims to fix a bug with codeframe regarding padding being inconsistent.
The bug was related to the last line in the codeframe being 10, which would result in the last index being 9 which in turn results in the line length being 1 as the index is 9 and not 10... This PR does a +1 before calculating the lastline number length to ensure it's always the actual number of the line instead of an index.
This was a pretty straightforward thing that should've been in the codeframe test-suite all along, but I overlooked it originally.
T-650 Line numbern in diagnostic codeframe aren't padded to constant length (unlink task)
💡Tip: Add "Close T-650" to the pull request title or description, to a commit message, or in a comment to mark this task as "Done" when the pull request is merged.
DeMoorJasper
changed the title
Improve number padding in codeframe
[T-650] Fix number padding in codeframe being incorrect if endLine == 10
Jul 11, 2020
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
↪️ Pull Request
This PR aims to fix a bug with codeframe regarding padding being inconsistent.
The bug was related to the last line in the codeframe being 10, which would result in the last index being 9 which in turn results in the line length being 1 as the index is 9 and not 10... This PR does a
+1
before calculating the lastline number length to ensure it's always the actual number of the line instead of an index.This was a pretty straightforward thing that should've been in the codeframe test-suite all along, but I overlooked it originally.