Say I have a string containing carriage returns (0x0D). I paste it into RSyntaxTextArea, then copy it from the text area and back into somewhere else. All my original carriage returns have been replaced with LFs (0x0A). This is the same thing Sublime Text does by default, and it's horrible.
I saw that the TextEditorPane has a setLineSeparator method, but it appears to do nothing. I set it to "\r" to test it out, but the incorrect behavior stayed exactly the same. In any case, that setLineSeparator method isn't what I need. The text area needs to be able to accept multiple types of line breaks (CR/LF/CRLF) and preserve them when copy/pasting between the pane and something else.
Is there a way for me to tell RSyntaxTextArea "No, contrary to popular belief you actually don't know what's best for me, leave my strings alone"?
Part 2: Is there a simple way to show "meta" characters in the text area? Like whenever a literal line feed is in the string, in the text pane it should show "\n" instead. Obviously when a user copies the string out from the text area it should not copy out a literal backslash and "n", but instead copy out the actual LF. We do this in our current application using JEdit. Here's what it looks like:
Obviously JEdit doesn't do all the fancy things that RSyntaxTextArea does like code folding, but at least it got these basic things right.