mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-156629 No replacement hint for the second and further occurrence in regex replace
This commit is contained in:
@@ -0,0 +1,165 @@
|
||||
--- FIND MODEL ---
|
||||
myStringToFind =
|
||||
myStringToReplace =
|
||||
isReplaceState =false
|
||||
isWholeWordsOnly =false
|
||||
searchContext =ANY
|
||||
isFromCursor =true
|
||||
isForward =true
|
||||
isGlobal =true
|
||||
isRegularExpressions =true
|
||||
isCaseSensitive =false
|
||||
isMultipleFiles =false
|
||||
isPromptOnReplace =true
|
||||
isReplaceAll =false
|
||||
isOpenNewTab =false
|
||||
isOpenInNewTabEnabled =false
|
||||
isOpenNewTabVisible =false
|
||||
isProjectScope =true
|
||||
directoryName =null
|
||||
isWithSubdirectories =true
|
||||
fileFilter =null
|
||||
moduleName =null
|
||||
customScopeName =null
|
||||
searchInProjectFiles =false
|
||||
|
||||
--
|
||||
|
||||
aba
|
||||
--
|
||||
------------
|
||||
--- FIND MODEL ---
|
||||
myStringToFind =a
|
||||
myStringToReplace =
|
||||
isReplaceState =false
|
||||
isWholeWordsOnly =false
|
||||
searchContext =ANY
|
||||
isFromCursor =true
|
||||
isForward =true
|
||||
isGlobal =true
|
||||
isRegularExpressions =true
|
||||
isCaseSensitive =false
|
||||
isMultipleFiles =false
|
||||
isPromptOnReplace =true
|
||||
isReplaceAll =false
|
||||
isOpenNewTab =false
|
||||
isOpenInNewTabEnabled =false
|
||||
isOpenNewTabVisible =false
|
||||
isProjectScope =true
|
||||
directoryName =null
|
||||
isWithSubdirectories =true
|
||||
fileFilter =null
|
||||
moduleName =null
|
||||
customScopeName =null
|
||||
searchInProjectFiles =false
|
||||
|
||||
--
|
||||
|
||||
[[<a>]]b[a]
|
||||
--
|
||||
RangeHighlighter: (1,2); layer:5999; tooltip: null : [java.awt.Color[r=0,g=0,b=0],java.awt.Color[r=255,g=255,b=0],0,BOXED,null,java.awt.Color[r=113,g=179,b=98]]
|
||||
RangeHighlighter: (1,2); layer:5999; tooltip: null : [null,null,0,ROUNDED_BOX,java.awt.Color[r=0,g=0,b=0],null]
|
||||
RangeHighlighter: (3,4); layer:5999; tooltip: null : [java.awt.Color[r=0,g=0,b=0],java.awt.Color[r=255,g=255,b=0],0,BOXED,null,java.awt.Color[r=113,g=179,b=98]]
|
||||
------------
|
||||
--- FIND MODEL ---
|
||||
myStringToFind =a
|
||||
myStringToReplace =c
|
||||
isReplaceState =false
|
||||
isWholeWordsOnly =false
|
||||
searchContext =ANY
|
||||
isFromCursor =true
|
||||
isForward =true
|
||||
isGlobal =true
|
||||
isRegularExpressions =true
|
||||
isCaseSensitive =false
|
||||
isMultipleFiles =false
|
||||
isPromptOnReplace =true
|
||||
isReplaceAll =false
|
||||
isOpenNewTab =false
|
||||
isOpenInNewTabEnabled =false
|
||||
isOpenNewTabVisible =false
|
||||
isProjectScope =true
|
||||
directoryName =null
|
||||
isWithSubdirectories =true
|
||||
fileFilter =null
|
||||
moduleName =null
|
||||
customScopeName =null
|
||||
searchInProjectFiles =false
|
||||
|
||||
--
|
||||
|
||||
[[<a>]]b[a]
|
||||
--
|
||||
RangeHighlighter: (1,2); layer:5999; tooltip: null : [java.awt.Color[r=0,g=0,b=0],java.awt.Color[r=255,g=255,b=0],0,BOXED,null,java.awt.Color[r=113,g=179,b=98]]
|
||||
RangeHighlighter: (1,2); layer:5999; tooltip: null : [null,null,0,ROUNDED_BOX,java.awt.Color[r=0,g=0,b=0],null]
|
||||
RangeHighlighter: (3,4); layer:5999; tooltip: null : [java.awt.Color[r=0,g=0,b=0],java.awt.Color[r=255,g=255,b=0],0,BOXED,null,java.awt.Color[r=113,g=179,b=98]]
|
||||
------------
|
||||
--- FIND MODEL ---
|
||||
myStringToFind =a
|
||||
myStringToReplace =c
|
||||
isReplaceState =true
|
||||
isWholeWordsOnly =false
|
||||
searchContext =ANY
|
||||
isFromCursor =true
|
||||
isForward =true
|
||||
isGlobal =true
|
||||
isRegularExpressions =true
|
||||
isCaseSensitive =false
|
||||
isMultipleFiles =false
|
||||
isPromptOnReplace =true
|
||||
isReplaceAll =false
|
||||
isOpenNewTab =false
|
||||
isOpenInNewTabEnabled =false
|
||||
isOpenNewTabVisible =false
|
||||
isProjectScope =true
|
||||
directoryName =null
|
||||
isWithSubdirectories =true
|
||||
fileFilter =null
|
||||
moduleName =null
|
||||
customScopeName =null
|
||||
searchInProjectFiles =false
|
||||
|
||||
--
|
||||
Replacement Preview: c
|
||||
--
|
||||
|
||||
[[<a>]]b[a]
|
||||
--
|
||||
RangeHighlighter: (1,2); layer:5999; tooltip: null : [java.awt.Color[r=0,g=0,b=0],java.awt.Color[r=255,g=255,b=0],0,BOXED,null,java.awt.Color[r=113,g=179,b=98]]
|
||||
RangeHighlighter: (1,2); layer:5999; tooltip: null : [null,null,0,ROUNDED_BOX,java.awt.Color[r=0,g=0,b=0],null]
|
||||
RangeHighlighter: (3,4); layer:5999; tooltip: null : [java.awt.Color[r=0,g=0,b=0],java.awt.Color[r=255,g=255,b=0],0,BOXED,null,java.awt.Color[r=113,g=179,b=98]]
|
||||
------------
|
||||
--- FIND MODEL ---
|
||||
myStringToFind =a
|
||||
myStringToReplace =c
|
||||
isReplaceState =true
|
||||
isWholeWordsOnly =false
|
||||
searchContext =ANY
|
||||
isFromCursor =true
|
||||
isForward =true
|
||||
isGlobal =true
|
||||
isRegularExpressions =true
|
||||
isCaseSensitive =false
|
||||
isMultipleFiles =false
|
||||
isPromptOnReplace =true
|
||||
isReplaceAll =false
|
||||
isOpenNewTab =false
|
||||
isOpenInNewTabEnabled =false
|
||||
isOpenNewTabVisible =false
|
||||
isProjectScope =true
|
||||
directoryName =null
|
||||
isWithSubdirectories =true
|
||||
fileFilter =null
|
||||
moduleName =null
|
||||
customScopeName =null
|
||||
searchInProjectFiles =false
|
||||
|
||||
--
|
||||
Replacement Preview: c
|
||||
--
|
||||
|
||||
cb[[<a>]]
|
||||
--
|
||||
RangeHighlighter: (3,4); layer:5999; tooltip: null : [java.awt.Color[r=0,g=0,b=0],java.awt.Color[r=255,g=255,b=0],0,BOXED,null,java.awt.Color[r=113,g=179,b=98]]
|
||||
RangeHighlighter: (3,4); layer:5999; tooltip: null : [null,null,0,ROUNDED_BOX,java.awt.Color[r=0,g=0,b=0],null]
|
||||
------------
|
||||
@@ -92,6 +92,17 @@ public class FindInEditorTest extends LightCodeInsightTestCase {
|
||||
checkResultByText("a <selection>b<caret></selection> b a");
|
||||
}
|
||||
|
||||
public void testSecondRegexReplaceShowsPopup() throws Exception {
|
||||
configureFromText("<caret> aba");
|
||||
initFind();
|
||||
myFindModel.setRegularExpressions(true);
|
||||
myFindModel.setStringToFind("a");
|
||||
myFindModel.setStringToReplace("c");
|
||||
myFindModel.setReplaceState(true);
|
||||
myLivePreviewController.performReplace();
|
||||
checkResults();
|
||||
}
|
||||
|
||||
private static void invokeFind() {
|
||||
executeAction(IdeActions.ACTION_FIND);
|
||||
UIUtil.dispatchAllInvocationEvents();
|
||||
|
||||
@@ -327,6 +327,7 @@ public class SearchResults implements DocumentListener {
|
||||
Collections.sort(myOccurrences, (findResult, findResult1) -> findResult.getStartOffset() - findResult1.getStartOffset());
|
||||
|
||||
myFindModel = findModel;
|
||||
myDocumentTimestamp = myEditor.getDocument().getModificationStamp();
|
||||
updateCursor(oldCursorRange, next);
|
||||
updateExcluded();
|
||||
notifyChanged();
|
||||
@@ -337,7 +338,6 @@ public class SearchResults implements DocumentListener {
|
||||
notifyCursorMoved();
|
||||
}
|
||||
dumpIfNeeded();
|
||||
myDocumentTimestamp = myEditor.getDocument().getModificationStamp();
|
||||
}
|
||||
|
||||
private void dumpIfNeeded() {
|
||||
|
||||
Reference in New Issue
Block a user