diff --git a/platform/lang-impl/api-dump-unreviewed.txt b/platform/lang-impl/api-dump-unreviewed.txt index bd07d7693ebf..0e02abeadc2c 100644 --- a/platform/lang-impl/api-dump-unreviewed.txt +++ b/platform/lang-impl/api-dump-unreviewed.txt @@ -7206,6 +7206,7 @@ f:com.intellij.find.FindUtil - s:showInUsageView(com.intellij.psi.PsiElement,com.intellij.psi.PsiElement[],java.lang.String,com.intellij.openapi.project.Project):com.intellij.usages.UsageView - s:showInUsageView(com.intellij.psi.PsiElement,java.lang.Object[],com.intellij.util.Function,java.lang.String,com.intellij.util.Consumer,com.intellij.openapi.project.Project):com.intellij.usages.UsageView - s:updateFindInFileModel(com.intellij.openapi.project.Project,com.intellij.find.FindModel,Z):V +- s:updateFindNextModel(com.intellij.openapi.project.Project,com.intellij.find.FindModel):V - s:useFindStringFromFindInFileModel(com.intellij.find.FindModel,com.intellij.openapi.editor.Editor):V com.intellij.find.FindUtil$ReplaceDelegate - a:shouldReplace(com.intellij.openapi.util.TextRange,java.lang.String):Z diff --git a/platform/lang-impl/src/com/intellij/find/EditorSearchSession.java b/platform/lang-impl/src/com/intellij/find/EditorSearchSession.java index 075801cf9b0e..683e9e8e0128 100644 --- a/platform/lang-impl/src/com/intellij/find/EditorSearchSession.java +++ b/platform/lang-impl/src/com/intellij/find/EditorSearchSession.java @@ -160,6 +160,7 @@ public class EditorSearchSession implements SearchSession, mySearchResults.clear(); EditorSearchSession.this.updateResults(FindSettings.getInstance().isScrollToResultsDuringTyping()); FindUtil.updateFindInFileModel(EditorSearchSession.this.getProject(), myFindModel, !ConsoleViewUtil.isConsoleViewEditor(editor)); + FindUtil.updateFindNextModel(getProject(), getFindModel()); } finally { myReentrantLock = false; @@ -554,7 +555,7 @@ public class EditorSearchSession implements SearchSession, myLivePreviewController.dispose(); } - private void updateResults(final boolean allowedToChangedEditorSelection) { + private void updateResults(boolean allowedToChangedEditorSelection) { final String text = myFindModel.getStringToFind(); if (text.isEmpty()) { nothingToSearchFor(allowedToChangedEditorSelection); @@ -578,16 +579,6 @@ public class EditorSearchSession implements SearchSession, return; } } - - - final FindManager findManager = FindManager.getInstance(getProject()); - if (allowedToChangedEditorSelection) { - findManager.setFindWasPerformed(); - FindModel copy = new FindModel(); - copy.copyFrom(myFindModel); - copy.setReplaceState(false); - findManager.setFindNextModel(copy); - } if (myLivePreviewController != null) { myLivePreviewController.updateInBackground(myFindModel, allowedToChangedEditorSelection); } diff --git a/platform/lang-impl/src/com/intellij/find/FindUtil.java b/platform/lang-impl/src/com/intellij/find/FindUtil.java index c48b486ecbcb..9f73b8f104f1 100644 --- a/platform/lang-impl/src/com/intellij/find/FindUtil.java +++ b/platform/lang-impl/src/com/intellij/find/FindUtil.java @@ -116,6 +116,15 @@ public final class FindUtil { model.setPromptOnReplace(false); } + public static void updateFindNextModel(@NotNull Project project, @NotNull FindModel with) { + FindManager findManager = FindManager.getInstance(project); + findManager.setFindWasPerformed(); + FindModel copy = new FindModel(); + copy.copyFrom(with); + copy.setReplaceState(false); + findManager.setFindNextModel(copy); + } + public static void updateFindInFileModel(@Nullable Project project, @NotNull FindModel with, boolean saveFindString) { FindModel model = FindManager.getInstance(project).getFindInFileModel(); model.setCaseSensitive(with.isCaseSensitive()); diff --git a/platform/lang-impl/src/com/intellij/openapi/editor/actions/IncrementalFindAction.java b/platform/lang-impl/src/com/intellij/openapi/editor/actions/IncrementalFindAction.java index 8f371357cedc..b1b6a1caae0a 100644 --- a/platform/lang-impl/src/com/intellij/openapi/editor/actions/IncrementalFindAction.java +++ b/platform/lang-impl/src/com/intellij/openapi/editor/actions/IncrementalFindAction.java @@ -57,6 +57,7 @@ public class IncrementalFindAction extends EditorAction implements ActionRemoteB if (!consoleViewEditor && editor.getSelectionModel().hasSelection()) { // selection is used as string to find without search model modification so save the pattern explicitly FindUtil.updateFindInFileModel(project, model, true); + FindUtil.updateFindNextModel(project, model); } } }