Bug 396764 - KTextEditor does not accept soft-hyphen as input
Summary: KTextEditor does not accept soft-hyphen as input
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.48.0
Platform: Neon Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-22 18:36 UTC by Tore Havn
Modified: 2019-08-27 18:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.62


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tore Havn 2018-07-22 18:36:38 UTC
I've recently added soft-hyphen as a key on my keyboard layout, and found that Kate does not accept it as input. Hitting the key has no effect in Kate.

I tried the same in LibreOffice Writer and in KWrite.

LibreOffice Writer handles it as expected, and creates a zero-width character in the text, which turns to a hyphen when the word it is in encounters a line break.

KWrite does not react, same as in Kate.
Comment 1 Tore Havn 2018-07-22 18:38:26 UTC
I should of course specify that the soft-hyphen character is U+00AD. (See https://unicode-table.com/en/00AD/)
Comment 2 Lothar 2019-02-22 17:51:18 UTC
I'm working on the wrap stuff since a while...
https://phabricator.kde.org/D19131
...and guess that the char is inserted but not handled yet.

You may try this: Edit&Save in Kate, Load&Look in LibreOffice Writer
Comment 3 Christoph Cullmann 2019-08-27 17:03:56 UTC
Git commit 0bf5522434044c61d266fc47bc127fef23d41e7b by Christoph Cullmann, on behalf of Ahmad Samir.
Committed on 27/08/2019 at 17:03.
Pushed by cullmann into branch 'master'.

Mimic QInputControl::isAcceptableInput() when filtering typed characters

Summary:
Move all input characters filtering out of typeChars() to KateViewInternal
and filter the input before sending it to typeChars().

This increases the scope of unicode characters that users can type in ktexteditor.
For more info see:
QChar documentation
http://www.unicode.org/Public/UNIDATA/UnicodeData.txt

This should fix:
- bug 396764 (typing soft-hyphens)
- bug 366424 (typing "private use" unicode characters)
- Hopefully bug 389796 (typing formatting characters such as ZWNJ)
Related: bug 366424, bug 389796

Test Plan:
Test typing a soft-hyphen char (here I used Compose key + minus + minus + space)
For the two other bugs, ask the users to test...

All unit tests passed

Reviewers: #ktexteditor, dhaumann, cullmann

Reviewed By: #ktexteditor, cullmann

Subscribers: kde-frameworks-devel, kwrite-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D23472

M  +1    -17   src/document/katedocument.cpp
M  +1    -1    src/document/katedocument.h
M  +85   -12   src/view/kateviewinternal.cpp
M  +5    -0    src/view/kateviewinternal.h

https://commits.kde.org/ktexteditor/0bf5522434044c61d266fc47bc127fef23d41e7b