You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move activation logic for SearchOptions.WHOLE_WORDS to FindReplaceLogic
when "whole words" is selected but a find-string was entered that is not
a whole word, the dialog/overlay will disable the option for "whole
words". However, the dialog/overlay will keep the selection of the
button in it's internal state. By passing the findString to this method,
we can make sure that we don't try to perform a whole-words search for a
string that isn't a whole word.
See eclipse-platform#1192 (comment)
Extracted from
eclipse-platform#1192
Copy file name to clipboardExpand all lines: bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/FindReplaceLogic.java
Copy file name to clipboardExpand all lines: bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/IFindReplaceLogic.java
+10
Original file line number
Diff line number
Diff line change
@@ -166,4 +166,14 @@ public interface IFindReplaceLogic {
166
166
*/
167
167
publicIFindReplaceTargetgetTarget();
168
168
169
+
/**
170
+
* Returns <code>true</code> if searching can be restricted to entire words,
171
+
* <code>false</code> if not. Searching for whole words requires the given find
172
+
* string to be an entire word and the regex search option to be disabled.
173
+
*
174
+
* @param findString the string that is currently being searched for.
175
+
* @return <code>true</code> if the search can be restricted to whole words
Copy file name to clipboardExpand all lines: tests/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/internal/findandreplace/FindReplaceLogicTest.java
+22
Original file line number
Diff line number
Diff line change
@@ -452,6 +452,28 @@ public void testSelectInSearchScope() {
Copy file name to clipboardExpand all lines: tests/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/FindReplaceDialogTest.java
+22
Original file line number
Diff line number
Diff line change
@@ -392,6 +392,28 @@ public void testReplaceAndFindAfterInitializingFindWithSelectedString() {
0 commit comments