diff options
Diffstat (limited to 'platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerExpressionComboBox.java')
-rw-r--r-- | platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerExpressionComboBox.java | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerExpressionComboBox.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerExpressionComboBox.java index 051683b875c1..3039d2acda7f 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerExpressionComboBox.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerExpressionComboBox.java @@ -17,9 +17,7 @@ package com.intellij.xdebugger.impl.ui; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.editor.event.DocumentAdapter; -import com.intellij.openapi.editor.event.DocumentEvent; -import com.intellij.openapi.editor.event.DocumentListener; +import com.intellij.openapi.editor.ex.EditorEx; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.ComboBox; import com.intellij.ui.EditorComboBoxEditor; @@ -101,6 +99,11 @@ public class XDebuggerExpressionComboBox extends XDebuggerEditorBase { } super.setItem(createDocument(((XExpression)anObject))); } + + @Override + protected void onEditorCreate(EditorEx editor) { + editor.putUserData(DebuggerCopyPastePreprocessor.REMOVE_NEWLINES_ON_PASTE, true); + } }; myEditor.getEditorComponent().setFontInheritedFromLAF(false); myComboBox.setEditor(myEditor); @@ -110,23 +113,6 @@ public class XDebuggerExpressionComboBox extends XDebuggerEditorBase { } @Override - protected Document createDocument(XExpression text) { - Document document = super.createDocument(text); - document.addDocumentListener(REPLACE_NEWLINES_LISTENER); - return document; - } - - private static DocumentListener REPLACE_NEWLINES_LISTENER = new DocumentAdapter() { - @Override - public void documentChanged(DocumentEvent e) { - String text = e.getNewFragment().toString(); - if (text.contains("\n")) { - e.getDocument().replaceString(e.getOffset(), e.getOffset() + e.getNewLength(), text.replace('\n', ' ')); - } - } - }; - - @Override protected void onHistoryChanged() { fillComboBox(); } |