mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
Bug 533379 - Only add space when appropriate
Only strings starting with "operator" should be subject to the space addition. Change-Id: I690695e7c3385e0d4e64ddd4cbe470a20cf788d6 Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This commit is contained in:
parent
fc8f2d6176
commit
864b305ff4
1 changed files with 6 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Niefer (Rational Software) - initial implementation
|
* Andrew Niefer (Rational Software) - initial implementation
|
||||||
|
* Torbjörn Svensson (STMicroelectronics) - bug #533379
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.search;
|
package org.eclipse.cdt.internal.ui.search;
|
||||||
|
|
||||||
|
@ -92,9 +93,11 @@ public class CSearchUtil {
|
||||||
*/
|
*/
|
||||||
public static String adjustSearchStringForOperators(String searchStr) {
|
public static String adjustSearchStringForOperators(String searchStr) {
|
||||||
int operatorIndex = searchStr.indexOf("operator"); //$NON-NLS-1$
|
int operatorIndex = searchStr.indexOf("operator"); //$NON-NLS-1$
|
||||||
int operatorCharIndex = operatorIndex + 8; // "operator" is 8 characters
|
if (operatorIndex >= 0) { // Only do this if string actually contains "operator"
|
||||||
if (operatorCharIndex < searchStr.length() && isOperatorChar(searchStr.charAt(operatorCharIndex))) {
|
int operatorCharIndex = operatorIndex + 8; // "operator" is 8 characters
|
||||||
searchStr = searchStr.substring(0, operatorCharIndex) + ' ' + searchStr.substring(operatorCharIndex);
|
if (operatorCharIndex < searchStr.length() && isOperatorChar(searchStr.charAt(operatorCharIndex))) {
|
||||||
|
searchStr = searchStr.substring(0, operatorCharIndex) + ' ' + searchStr.substring(operatorCharIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return searchStr;
|
return searchStr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue