Skip to content

Fix RTL and mixed BiDi text in text_editor and text_input#3294

Draft
hojjatabdollahi wants to merge 5 commits intoiced-rs:masterfrom
hojjatabdollahi:fix-rtl-editor
Draft

Fix RTL and mixed BiDi text in text_editor and text_input#3294
hojjatabdollahi wants to merge 5 commits intoiced-rs:masterfrom
hojjatabdollahi:fix-rtl-editor

Conversation

@hojjatabdollahi
Copy link
Copy Markdown
Contributor

@hojjatabdollahi hojjatabdollahi commented Mar 27, 2026

Draft until pop-os/cosmic-text#491 is merged.
Draft until new cosmic-text release.

This fixes issues with RTL text in text_editor and text_input.

Currently both hit detection and highlighting is wrong.

This PR switches from the custom highlight algorithm to the one in cosmic-text for editor.

before:

recording-2026-03-26_18-28-35.mp4

after:

recording-2026-03-26_18-35-31.mp4

This also updates text input widget and adds RTL and mixed bidi support. The changes to text input is bigger, because it's a specialized input (single line, password support, etc), so I had to copy bidi support for it from cosmic-text.

image

Fixes #1877, #2102, and #1454

@hojjatabdollahi hojjatabdollahi changed the title Use cosmic-text editor's hightlight and cursor position Fix RTL and mixed BiDi text in text_editor Mar 27, 2026
@hecrj hecrj added bug Something isn't working text widget fix labels Mar 27, 2026
@hecrj hecrj added this to the 0.15 milestone Mar 27, 2026
This fixes issues with RTL text in `text_editor`
@hojjatabdollahi hojjatabdollahi force-pushed the fix-rtl-editor branch 2 times, most recently from efb491e to 50ed8f3 Compare April 9, 2026 03:57
@hojjatabdollahi hojjatabdollahi changed the title Fix RTL and mixed BiDi text in text_editor Fix RTL and mixed BiDi text in text_editor and text_input Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix text widget

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Right-to-left script not showing in TextInput widget

2 participants