RSyntaxTextArea
RSyntaxTextArea copied to clipboard
Represent non-printable characters using another form
Describe the solution you'd like Currently the editor does not show non-printable characters such as Control Characters (https://www.geeksforgeeks.org/control-characters/)
Additional context Burp Suite (https://portswigger.net/burp/documentation/desktop/getting-started/download-and-install) which has been written in Java currently has a feature in its editor to allow this which can be used for inspiration. The following screenshot shows Burp Suite Repeater tab which can be used to edit requests:

We do have the following methods that render certain non-visible characters, but not all:
These methods do have limitations however:
- The first one only renders spaces and tabs, not say
\f, and how it chooses to render them is not configurable - The second one renders all line terminators the same, because as a standard
JTextComponent, all content has line endings normalized to\nwhile in the editor. Thus if you have a file with a mixture of different line endings, you won't know (and in fact, saving via saywrite(Writer)will normalize them). It also does not allow you to customize how line terminators are rendered.
I think it is still beneficial to display both \r and \n separately as they can be quite important when testing parsers or performing software testing. In the Burp Suite example, it displays them separately but also start the next character from the next line only for \n to make it readable.
If I want to extend the code to add a support for other non-printable characters similar to Burp Suite, what path I should follow in terms of changing the code?