Repository navigation
Replies: 4 comments 3 replies
|
I'd say 1. |
1 reply
|
Yes. Early return for |
0 replies
|
What is the intended behavior when |
0 replies
|
Good question. I don't really remember. Probably is death path. I can't remember a case covering it, but I cannot confirm 100%. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm writing unit tests for
GenericLineTransformerand have a question about the intended behavior forSetTextStylewhen a value of zero is passed for thelengthparameter.AvaloniaEdit/src/AvaloniaEdit.TextMate/GenericLineTransformer.cs
Lines 32 to 69 in e88d73a
When
length == 0is passed, the condition length > 0 is false, so execution falls into the else branch and styles the entire line —startOffsetandendOffsetare set toline.Offsetandline.EndOffsetrespectively.This seems to be unintentional. There are two plausible caller intents when passing
length = 0, and neither of them is "style the whole line":The else branch silently does something completely different from what either intent would expect,
All reactions