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) {
419419 // TODO(garyq): Handle this in the text editor caret code instead at layout
420420 // level.
421421 bool has_trailing_whitespace = false ;
422- bool is_leading = false ; // True if the whitespace is a leading whitespace.
423422 int32_t bidi_run_start, bidi_run_length;
424423 if (bidi_run_count > 1 ) {
425424 ubidi_getVisualRun (bidi.get (), bidi_run_count - 1 , &bidi_run_start,
@@ -437,11 +436,10 @@ bool ParagraphTxt::ComputeBidiRuns(std::vector<BidiRun>* result) {
437436 ubidi_getVisualRun (bidi.get (), bidi_run_count - 2 ,
438437 &second_last_bidi_run_start,
439438 &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--;
442442 }
443- has_trailing_whitespace = true ;
444- bidi_run_count--;
445443 }
446444 }
447445 }
@@ -484,9 +482,6 @@ bool ParagraphTxt::ComputeBidiRuns(std::vector<BidiRun>* result) {
484482 // Attach the final trailing whitespace as part of this run.
485483 if (has_trailing_whitespace && bidi_run_index == bidi_run_count - 1 ) {
486484 bidi_run_length++;
487- if (is_leading) {
488- bidi_run_start--;
489- }
490485 }
491486
492487 size_t bidi_run_end = bidi_run_start + bidi_run_length;
You can’t perform that action at this time.
0 commit comments