I am on Linux, I open a Text Editor which has EOL of Unix.
I then file a file which is EOL PC, then right mouse click and choose "Open in Current Window" and the the file opens in current window by EOL is still Unix. It should be PC.
Same problem with Dragging and Dropping a file into the editor to open it.
Yet, Open File works. Actually, it seems to only work if there hasn't been a previously open file. If there was a previously open file then it maintains the previous EOL value.
When the (Base)Document is initialized it saves the 1st line separator from the buffer in a property. It doesn't change afterwards.
"Open in Current Window" should create another JEditor anyhow, so I wonder how come the EOL separator isn't read again. Might be a bug on our side or perhaps you are recycling the same JEditorPane/Document. Same with drag and drop.
The way I see it if I open from the Files tree a PC/UNIX file it shows the separator properly in the status bar.
But if I use Open (Cmd+O) from the editor toolbar and I open the opposite file in the same editor, the EOL separator remains unchanged (but the tab title changes).
My guess is that the JEditorPane isn't re-created.
When the (Base)Document is initialized it saves the 1st line separator from the buffer in a property. It doesn't change afterwards.
"Open in Current Window" should create another JEditor anyhow, so I wonder how come the EOL separator isn't read again. Might be a bug on our side or perhaps you are recycling the same JEditorPane/Document. Same with drag and drop.
The way I see it if I open from the Files tree a PC/UNIX file it shows the separator properly in the status bar.
But if I use Open (Cmd+O) from the editor toolbar and I open the opposite file in the same editor, the EOL separator remains unchanged (but the tab title changes).
My guess is that the JEditorPane isn't re-created.
This problem is back, and I assume it has to do with the fact that we change the re-initialization behavior. Emilian, how do I tell the editor to re-detect the EOL? This is in CEditorPanelView.
This problem is back, and I assume it has to do with the fact that we change the re-initialization behavior. Emilian, how do I tell the editor to re-detect the EOL? This is in CEditorPanelView.
I can't actually detect the exact moment when I should reload the CRLF so I've added EditorPreferences.clearCRLF(JTextComponent) to clear it and it will be picked-up on the next Document.read (which means, after you call setText on the JTextComponent). Seems to work and it's a small patch.
All you have to do on your side is call EditorPreferences.clearCRLF(JTextComponent) before calling JTextComponent.setText().
I can't actually detect the exact moment when I should reload the CRLF so I've added EditorPreferences.clearCRLF(JTextComponent) to clear it and it will be picked-up on the next Document.read (which means, after you call setText on the JTextComponent). Seems to work and it's a small patch.
All you have to do on your side is call EditorPreferences.clearCRLF(JTextComponent) before calling JTextComponent.setText().
SVN #29831 has the addition of : EditorPreferences.clearCRLF(JTextComponent) : to CEditorPanelView. close/saveas/open
SVN #29831 has the addition of : EditorPreferences.clearCRLF(JTextComponent) : to CEditorPanelView. close/saveas/open
Issue #7608 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build Vincaed 3.0.5.1 |
No time estimate |
Same problem with Dragging and Dropping a file into the editor to open it.
Yet, Open File works. Actually, it seems to only work if there hasn't been a previously open file. If there was a previously open file then it maintains the previous EOL value.