unicode/bidi: fix Direction zero value to Neutral#61
unicode/bidi: fix Direction zero value to Neutral#61pgundlach wants to merge 1 commit intogolang:masterfrom
Conversation
|
This PR (HEAD: 0956714) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/text/+/762820. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/762820. |
The Direction constants had LeftToRight as iota (value 0), making it indistinguishable from the zero value of an unset Direction field. This caused DefaultDirection(LeftToRight) to be silently ignored in Paragraph.Order(), as the code could not distinguish between "user explicitly set LTR" and "no direction was set." Reorder the Direction constants so that Neutral is the zero value, and add an explicit case for LeftToRight in Order() to set the paragraph embedding level to 0. Fixes golang/go#71809
0956714 to
a74a5b3
Compare
|
This PR (HEAD: a74a5b3) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/text/+/762820. Important tips:
|
|
Message from Patrick Gundlach: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/762820. |
|
Message from Patrick Gundlach: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/762820. |
The Direction constants had LeftToRight as iota (value 0), making it
indistinguishable from the zero value of an unset Direction field.
This caused DefaultDirection(LeftToRight) to be silently ignored in
Paragraph.Order(), as the code could not distinguish between "user
explicitly set LTR" and "no direction was set."
Reorder the Direction constants so that Neutral is the zero value,
and add an explicit case for LeftToRight in Order() to set the
paragraph embedding level to 0.
Fixes golang/go#71809