This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -419,7 +419,6 @@ bool ParagraphTxt::ComputeBidiRuns(std::vector<BidiRun>* result) {
419
419
// TODO(garyq): Handle this in the text editor caret code instead at layout
420
420
// level.
421
421
bool has_trailing_whitespace = false ;
422
- bool is_leading = false ; // True if the whitespace is a leading whitespace.
423
422
int32_t bidi_run_start, bidi_run_length;
424
423
if (bidi_run_count > 1 ) {
425
424
ubidi_getVisualRun (bidi.get (), bidi_run_count - 1 , &bidi_run_start,
@@ -437,11 +436,10 @@ bool ParagraphTxt::ComputeBidiRuns(std::vector<BidiRun>* result) {
437
436
ubidi_getVisualRun (bidi.get (), bidi_run_count - 2 ,
438
437
&second_last_bidi_run_start,
439
438
&second_last_bidi_run_length);
440
- if (bidi_run_start < second_last_bidi_run_start) {
441
- is_leading = true ;
439
+ if (bidi_run_start >= second_last_bidi_run_start) {
440
+ has_trailing_whitespace = true ;
441
+ bidi_run_count--;
442
442
}
443
- has_trailing_whitespace = true ;
444
- bidi_run_count--;
445
443
}
446
444
}
447
445
}
@@ -484,9 +482,6 @@ bool ParagraphTxt::ComputeBidiRuns(std::vector<BidiRun>* result) {
484
482
// Attach the final trailing whitespace as part of this run.
485
483
if (has_trailing_whitespace && bidi_run_index == bidi_run_count - 1 ) {
486
484
bidi_run_length++;
487
- if (is_leading) {
488
- bidi_run_start--;
489
- }
490
485
}
491
486
492
487
size_t bidi_run_end = bidi_run_start + bidi_run_length;
You can’t perform that action at this time.
0 commit comments