Treat 0x0000 to 0x001F as non-printable
This MR is related to the feature mentioned in !698 (merged) 's description, intended to bring support to display often-to-see non-printable control characters in the text document.
The feature itself can be considered as one of the deal breakers for Notepad++-style users to switch to Kate. see https://www.reddit.com/r/kde/comments/1boo570/kate_is_there_a_way_to_display/
This MR only adds the most basic control characters to the regex, so it can at least be rendered as a red rectangle when Show Non-Printable Spaces
is toggled. My final goal (after this MR) is to see the possibility to render these control characters the same way as what Scintilla (the editor component that Notepad++ uses) does, but currently have no clue on how to achieve it, so any related help is appreciated!
The following screenshot shows the current state:
- Left: Kate with this patch applied to KF6TextEditor,
Show Non-Printable Spaces
turned on. - Middle: Unpatched Kate,
Show Non-Printable Spaces
turned on. - Right: Notepad++,
Show All Characters
turned on.
The content of the text document:
Links that might related:
- user voices:
- https://bugs.kde.org/show_bug.cgi?id=488784 request for action icons so users can put these actions to the toolbar and make it icon-only