From 10805ef9a41ce43e1732ef681bd54b658cdb3252 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 11 Mar 2016 03:57:20 +0000 Subject: [PATCH] Strip newlines when copy & pasting in new formats --- source/net/filebot/ui/rename/FormatDialog.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/net/filebot/ui/rename/FormatDialog.java b/source/net/filebot/ui/rename/FormatDialog.java index e26487c8..3ab79393 100644 --- a/source/net/filebot/ui/rename/FormatDialog.java +++ b/source/net/filebot/ui/rename/FormatDialog.java @@ -59,6 +59,14 @@ import javax.swing.event.PopupMenuListener; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; +import org.fife.ui.rsyntaxtextarea.RSyntaxDocument; +import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; +import org.fife.ui.rsyntaxtextarea.SyntaxConstants; +import org.fife.ui.rtextarea.RTextScrollPane; + +import com.cedarsoftware.util.io.JsonReader; +import com.cedarsoftware.util.io.JsonWriter; + import net.filebot.ResourceManager; import net.filebot.Settings; import net.filebot.UserFiles; @@ -86,14 +94,6 @@ import net.filebot.web.MovieIdentificationService; import net.filebot.web.MusicIdentificationService; import net.miginfocom.swing.MigLayout; -import org.fife.ui.rsyntaxtextarea.RSyntaxDocument; -import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; -import org.fife.ui.rsyntaxtextarea.SyntaxConstants; -import org.fife.ui.rtextarea.RTextScrollPane; - -import com.cedarsoftware.util.io.JsonReader; -import com.cedarsoftware.util.io.JsonWriter; - public class FormatDialog extends JDialog { private boolean submit = false; @@ -328,7 +328,7 @@ public class FormatDialog extends JDialog { final RSyntaxTextArea editor = new RSyntaxTextArea(new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_GROOVY) { @Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { - super.insertString(offs, str.replaceAll("\\s", " "), a); // FORCE SINGLE LINE + super.insertString(offs, str.replaceAll("\\R", ""), a); // FORCE SINGLE LINE } }, null, 1, 80);