Bug 461320 - [Feature] Allow per-file override of BiDi paragraph detection
Summary: [Feature] Allow per-file override of BiDi paragraph detection
Status: RESOLVED DUPLICATE of bug 433926
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: 22.08.2
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-02 14:22 UTC by Oded Arbel
Modified: 2022-11-02 16:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Some text where each line starts in LTR or RTL (62.83 KB, image/png)
2022-11-02 14:23 UTC, Oded Arbel
Details
Example of opening a CSV with mixed directionality chars (87.27 KB, image/png)
2022-11-02 14:24 UTC, Oded Arbel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oded Arbel 2022-11-02 14:22:41 UTC
SUMMARY:

When editing a file that contains BiDi text, Kate implements paragraph direction detection on a per-line basis, i.e. when the file has some lines that start with a strong LTR chracter and some that start with a string RTL character, then different lines use different paragraph directions (start rendering from the right or left side of the window). This makes editing the text very confusing, especially when both LTR and RTL lines are being wrapped from different directions.

Ideally, IMHO there should not be paragraph direction in a line-based text editor (as opposed to a word-processor, see for example bug #144495), but if Kate wants to support editing in RTL mode - which will be useful for editing texts that are written completely in an RTL language - then a button to enable document wide RTL mode would be useful, similar to how a spreadsheet application handles RTL spreadsheets, by enforcing the RTL context on the entire sheet.

STEPS TO REPRODUCE
1. Create a text file with where the first strong directionality character is sometimes LTR and sometimes RTL, for example, a CSV where the first column is a number and the second column is a list of names in their original spelling, some English and some, lets say, Persian.
2. Open the file in Kate

OBSERVED RESULT
Some of the lines a left aligned and some are right aligned.

EXPECTED RESULT
All the lines should be aligned the same way.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
See screenshots of example mixed alignment files.
Comment 1 Oded Arbel 2022-11-02 14:23:09 UTC
Created attachment 153402 [details]
Some text where each line starts in LTR or RTL
Comment 2 Oded Arbel 2022-11-02 14:24:26 UTC
Created attachment 153403 [details]
Example of opening a CSV with mixed directionality chars

This file is essentially a table, it makes no sense that the columns are all out of whack. Using tabs instead of commas should make it easier to see the table, but it doesn't work if some lines are aligned differently.
Comment 3 Waqar Ahmed 2022-11-02 16:22:50 UTC

*** This bug has been marked as a duplicate of bug 433926 ***