-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lines appearing after coping and refilling text #141
Comments
Hi Tomas, I have the same problem! There are double line breaks after several copy and paste from/into the TextArea (in the TextArea these double linebreaks are not displayed, only outside in a text editor) Regards Michael |
It seems like when you paste text into the area, then the line breaks are doubled... |
This seems like a Windows-only problem. Or can anyone reproduce it on Mac or Linux? I only have Mac and Linux available. The cause is likely the following two "features" not working well together:
As a result, if you copy text with Windows line terminators ( |
I downloaded the JavaKeywords demo and tested it on Linux. After doing the above method using Linux's GEdit (Text Editor) and again using a Word Processor (Kingsoft Writer), I didn't have the problem. |
Thanks for testing, Jordan! |
Hi Tomas, thanks for your reply. I really get double 0D0A0D0A (\r\n\r\n). Do you suggest a workaround? |
The workaround would be to override Ctrl+C, Ctrl+X, Ctrl+V and do the right thing there. You would put the selected text to the clipboard, with all line terminators replaced by |
Thank you for your reply, Tomas! |
another possible workaround using awt codeArea.addEventFilter(KeyEvent.KEY_RELEASED, new EventHandler<KeyEvent>() {
@Override
public void handle(KeyEvent event) {
if (event.isControlDown() && event.getCode() == KeyCode.C){
java.awt.datatransfer.Clipboard clipboard = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
java.awt.datatransfer.StringSelection stringSelection = new java.awt.datatransfer.StringSelection (messageContentCodeArea.getText());
clipboard.setContents(stringSelection, null);
event.consume();
}
}
}); |
Step 1:
I copy the text out of Java Keywords Demo and filling it into Notepad++. Everything perfect.
Step 2:
After that, I copy the text out of the Notepad++ and filling it into Java Keywords Demo. Everything perfect.
Step 3:
I repeat Step 1 and have the effect that between every code line is a empty line appearing.
The text was updated successfully, but these errors were encountered: