Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2011-05-16 03:36:53 -0400
committerAnton Leherbauer2011-05-16 03:36:53 -0400
commit83719f04cc96d483d0a32a6db40122d007f51b3c (patch)
treef3a1ea9c48e2c203fcc38a103f5e5634edb18cdc /debug/org.eclipse.cdt.debug.ui
parentf87a7ad4e3aeebb4d37bcbebccf2f50a0b17ea89 (diff)
downloadorg.eclipse.cdt-83719f04cc96d483d0a32a6db40122d007f51b3c.tar.gz
org.eclipse.cdt-83719f04cc96d483d0a32a6db40122d007f51b3c.tar.xz
org.eclipse.cdt-83719f04cc96d483d0a32a6db40122d007f51b3c.zip
Bug 340526 - Create watch expression: line endings should be removed
Patch by Axel Mueller
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddExpressionEditorActionDelegate.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddExpressionEditorActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddExpressionEditorActionDelegate.java
index 33e789f65d..0b1c15b9b0 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddExpressionEditorActionDelegate.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddExpressionEditorActionDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 QNX Software Systems and others.
+ * Copyright (c) 2004, 2011 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -54,6 +54,7 @@ public class AddExpressionEditorActionDelegate extends ActionDelegate implements
fEditorPart = editorPart;
}
+ @Override
public void run( IAction action ) {
String text = getSelectedText();
ExpressionDialog dlg = new ExpressionDialog( getShell(), text );
@@ -66,7 +67,7 @@ public class AddExpressionEditorActionDelegate extends ActionDelegate implements
private String getSelectedText() {
ISelection selection = getTargetSelection();
if ( selection != null && selection instanceof ITextSelection ) {
- return ((ITextSelection)selection).getText().trim();
+ return ((ITextSelection)selection).getText().replaceAll("(\\r\\n|\\n|\\t| )+", " ").trim(); //$NON-NLS-1$ //$NON-NLS-2$;
}
return ""; //$NON-NLS-1$
}

Back to the top