godotengine / godotengine/godot
Cursor jumps between start and end of line when line begins with a RTL letter while typing with non-RTL letters and symbols
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
v4.3.dev5.official [89f70e98d]
### System information
Apple M1, Ubuntu 20.04 LTS
### Issue description
See title.
### Steps to reproduce
1. Optionally download the MRP (rtl_jumps.zip) then go to step 9. Otherwise follow steps 2-8 to recreate the MRP.
2. Create a csv called `translations.csv` and add the following:
key,en,ar
test,test,test
3. Create a new project.
4. Click on `User Inteface` and replace the root node with a `LineEdit` node.
5. Move `translations.csv` created in step 2 into the new project.
6. Project -> Project Settings...
7. Click on the `Localization` tab, click `Add...` and choose `translations.ar.translation` and `translations.en.translation`.
8. Click on the `General` tab, toggle `Advanced Settings`, Internationalization -> Locale, set `Test` to `ar`.
9. Run the project.
10. Paste this Arabic letter as the first letter: `ﺵ`
11. Alternate between English letters and symbols, like `a,bd;e:f`, and watch the cursor jump back and forth.
https://github.com/godotengine/godot/assets/135338122/31032bb4-0e11-49dd-beca-7087bdc3a9bd
**Notes**
1. ( ), { }, [ ], are confusing since the opposite brace appears, though I don't know what the expected behavior should be.
2. The issue does not occur if an English letter was typed first. However, the cursor behaves strangely once an Arabic letter is typed. For example, type this: `abc` then paste `ﺵ`. Notice the cursor is to the left of `ﺵ`. If you type another symbol or English letter the cursor will jump to the right. Again, I don't know if this is expected.
3. You can see https://github.com/godotengine/godot/issues/84370 in the video
### Minimal reproduction project (MRP)
[rtl_jumps.zip](https://github.com/godotengine/godot/files/14758778/rtl_jumps.zip)
Contributor guide
Assessment
This issue has not been assessed yet.