-
Notifications
You must be signed in to change notification settings - Fork 2
Bidi ordering #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Bidi ordering #24
Conversation
|
Not sure what is happening with the CI checks |
whereswaldon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these changes will work. There may be a "better" way to iterate the runs in-order, but the difference also might not matter for this use-case.
| line = wrapped.Line | ||
|
|
||
| // sort the line by visual order | ||
| sort.Slice(line, func(i, j int) bool { return line[i].VisualIndex < line[j].VisualIndex }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine if we aren't going to do any processing that might rely on the logical ordering, but it is a lossy operation. After this sort, we no longer have easy access to the logical ordering.
In Gio's code, I just traverse the line's VisualOrder array when doing display logic. It's still efficient, but doesn't discard anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledged, thank you. We could apply your suggestion if required in future work.
Ah, that's the x/tools Go version bug that was resolved by updating the tools package to (details at golang/go#74462) |
Thanks @andydotxyz ! Any hint on how to process to use v0.24.1 ? |
|
Can the go.mod be updated to require that version? Either the indirect section or through a replace. I don't have an example to hand sorry as Fyne uses it directly so our fixes were more straight forward. |
…verall direction of the string
b84f19f to
dbef80d
Compare
|
Rebasd on top of the CI fix. |
Use
LineWrapperto compute bidi visual index; also set the overall direction of the string.Closes #23