This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ class CanvasParagraph implements ui.Paragraph {
237
237
}
238
238
239
239
final ParagraphLine line = lines[i];
240
- return ui.TextRange (start: line.startIndex, end: line.endIndex);
240
+ return ui.TextRange (start: line.startIndex, end: line.endIndex - line.trailingNewlines );
241
241
}
242
242
243
243
@override
Original file line number Diff line number Diff line change @@ -700,7 +700,8 @@ Future<void> testMain() async {
700
700
for (int i = 0 ; i < 11 ; i++ ) {
701
701
expect (
702
702
paragraph.getLineBoundary (ui.TextPosition (offset: i)),
703
- const ui.TextRange (start: 0 , end: 11 ),
703
+ // The "\n" is not included in the line boundary.
704
+ const ui.TextRange (start: 0 , end: 10 ),
704
705
reason: 'failed at offset $i ' ,
705
706
);
706
707
}
@@ -709,7 +710,8 @@ Future<void> testMain() async {
709
710
for (int i = 11 ; i < 23 ; i++ ) {
710
711
expect (
711
712
paragraph.getLineBoundary (ui.TextPosition (offset: i)),
712
- const ui.TextRange (start: 11 , end: 23 ),
713
+ // The "\n" is not included in the line boundary.
714
+ const ui.TextRange (start: 11 , end: 22 ),
713
715
reason: 'failed at offset $i ' ,
714
716
);
715
717
}
You can’t perform that action at this time.
0 commit comments