-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Description
Currently, the flutter_code_editor does not properly handle Right-to-Left (RTL) languages, specifically Arabic. This causes several UI and UX issues when writing or displaying Arabic code comments, strings, or documentation within the editor.
Current Behavior
- Text alignment defaults to Left-to-Right (LTR) even when the system locale or specific text is Arabic.
- Cursors and selection highlights might behave unpredictably in RTL contexts.
- Punctuation and mixed LTR/RTL text (BiDi) are rendered incorrectly, breaking the code's visual structure.
Expected Behavior
- The editor should detect or allow setting the
textDirectiontoTextDirection.rtl. - Proper cursor placement and movement logic for RTL text.
- Support for Arabic characters without overlapping or rendering issues in the code lines.
Proposed Solution (I can contribute this!)
I have investigated the rendering logic and the CodeField implementation. I plan to submit a PR that:
- Integrates
textDirectionsupport into the editor's styling. - Fixes the horizontal scrolling and alignment for RTL lines.
- Ensures the gutter (line numbers) stays correctly positioned relative to the RTL text.
Metadata
Metadata
Assignees
Labels
No labels