Bug 569834

Summary: Broken bidirectional support after 4.7.3a, making the cursor position inconsistent with text direction
Product: [Eclipse Project] Platform Reporter: Mohamad Fakih <mfakih294>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: critical    
Priority: P3 CC: albert.tregnaghi, mfakih294
Version: 4.8   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Eclipse 4.11
none
4.7.3a
none
Globalization settings none

Description Mohamad Fakih CLA 2020-12-19 12:57:56 EST
Created attachment 285082 [details]
Eclipse 4.11

Eclipse 4.7.3a, to my investigation, was the last version to fully support writing in right-to-left direction, and getting the heading in the outline view in the correct orientation (see screenshot "Eclipse 4.7.3a"). However, after the upgrade, and in all major versions published on the Eclipse website, including the latest one, a severe problem occurred:

When eclipse is run with "-dir rtl", or the Globalization settings were both set to "Righ-to-left" (see screenshot "Globalization"), the text will display from right-to-left both in direction and alignment (as it's supposed to be), yet the cursor remain left aligned, and so out of sync with the text i.e. if you click over the first letter (near the right edge of the editor), the cursor will show near the left edge of the editor, and vice versa. If you click near 1/3 from the right, the cursor will show 1/3 from the left ... (see sample screenshot "Eclipse 4.11").

Another problem is the display of latin (ltr) terms, so "doc.md" was displayed mirrored (see screenshot), and so hardly readable.

How to reproduce:

Type "أكل الولد التفاحة" (wihtout quotes) in the editor (tested with the plain and Mylyn WikiText editor), after setting the IDE layout to RTL (as mentioned at the beginning), then click on any letter. You'll see the cursor does not show where you clicks (although if you type, your edit will be in the right place).
Comment 1 Mohamad Fakih CLA 2020-12-19 12:59:09 EST
Created attachment 285083 [details]
4.7.3a
Comment 2 Mohamad Fakih CLA 2020-12-19 12:59:35 EST
Created attachment 285084 [details]
Globalization settings