Bug 367909

Summary: Pressing Backspace skips Arabic and Hebrew diacritics
Product: [Applications] kate Reporter: Safa Alfulaij <safa1996alfulaij>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: jgrulich
Priority: NOR    
Version First Reported In: 16.04   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Safa Alfulaij 2016-08-28 04:42:34 UTC
When you have a text that ends with a diacritic (https://en.wikipedia.org/wiki/Arabic_diacritics, https://en.wikipedia.org/wiki/Hebrew_diacritics), pressing backspace will ignore it and remove the whole character (what is called cluster).
In normal text edits (QLineEdit, QTextEdit), each diacritic is removed first, and when there is non left, another backspace press will delete the character.

The reason of this is using "previousCursorPosition" method, as cursor doesn't move when adding diacritics. And so, the previous position will be the last character.

Sample text (With diacritic at the end): "ذهبَ"
Sample text (With two diacritics at the end): "حيٌّ"

Reproducible: Always

Steps to Reproduce:
1. Write/Copy-Paste sample text
2. Press backspace

Actual Results:  
The character with it's diacritics are all removed

Expected Results:  
َ    diacritic is removed in the first sample text, and
ٌ    diacritic is removed in the second sample text
Comment 1 Dominik Haumann 2016-08-28 10:25:31 UTC
Is this maybe a regrssion caused by https://git.reviewboard.kde.org/r/127843/ ?
Comment 2 Safa Alfulaij 2016-08-28 10:41:03 UTC
(In reply to Dominik Haumann from comment #1)
> Is this maybe a regrssion caused by
> https://git.reviewboard.kde.org/r/127843/ ?

Looks like that!
But, Qt normal widgets doesn't remove the Indic composed characters as whole! The characters are removed "base" by "base". This is the way used in Chromium, LibreOffice and Gtk.
Comment 3 Safa Alfulaij 2017-02-14 06:15:36 UTC
Ping.
I'd say an option in the settings can be done so that the user is able to choose the behaviour he need.
This is really annoying, all other apps works correctly.