RSyntaxTextArea icon indicating copy to clipboard operation
RSyntaxTextArea copied to clipboard

Preserve line endings

Open bobbylight opened this issue 11 years ago • 1 comments

When a user pastes text into RSTA, newlines are normalized into \n. This is standard JTextComponent behavior. RSTA would be friendlier if it remembered the "right" newline between each line of text.

To do this, RSTA will have to handle text inserted into Documents, probably via changes to RSyntaxDocument. RSyntaxTextArea#read() and #write() may also need to be modified to preserve line endings as well.

An excellent starting point can be found in the RSTA forums here:

http://fifesoft.com/forum/viewtopic.php?f=11&t=858

bobbylight avatar Jan 09 '15 03:01 bobbylight

I would call this one rather important because of things like git. One of the nice things about Notepad++ and Eclipse is their ability to preserve line endings. Then opening a file and making a 1 line change doesn't turn into a 500 line git commit just because the users platform uses a different separator.

RobertBColton avatar Sep 23 '16 22:09 RobertBColton