#12 Invisible Characters



For example Notepad++ (freeware software) has a feature "Show all characters"
If I press the icon "Show all characters", I can see the invisible characters like "carriage return", "line feed" and "tab".

Tab will be shown as ->
Space will be -> ·
Carriage return will be shown as CR (Mac)
Line feed will be shown as LF (Linux)
Carriage return and Line feed will be shown CRLF (DOS)

How can I make invisible characters visible via RSyntaxTextArea?

Similar code can be found for JEditorPane/JTextPane http://java-sl.com/showpar.html
(I think there is no differ between the 3 type of linebreaks.)



  • Robert Futrell

    Robert Futrell - 2010-01-15
    • assigned_to: nobody --> robert_futrell
    • status: open --> pending
  • Robert Futrell

    Robert Futrell - 2010-01-15

    Hi Kalem,

    The current official release (1.4.0) already supports visible spaces and tabs via setWhitespaceVisible(boolean).

    As for newlines, I just added methods to get and set whether EOL markers are rendered:

    public boolean getEOLMarkersVisible();
    public void setEOLMarkersVisible(boolean);

    This was added in revision 153 in Subversion. If you want to try it out before the next release you can grab it here:


    Unfortunately, you're right that with Swing text components, you cannot determine which of the three common line endings is at the end of each line; you can only put a "line terminator" symbol. This is what has been implemented in RSTA, very similar to what is in the link you provided.

  • Robert Futrell

    Robert Futrell - 2010-03-11

    The EOL marker API has been added in 1.4.1.

  • Robert Futrell

    Robert Futrell - 2010-03-11
    • status: pending --> closed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks