mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
[regexp] IDEA-311133 CheckRegExpForm class loaded without real need on first file opening
GitOrigin-RevId: aeb595ff5ad2cea63d6c3cfe9587194d3c22d31d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
69c890420b
commit
f464d039d4
@@ -67,11 +67,20 @@ import java.util.regex.Pattern;
|
||||
public final class CheckRegExpForm {
|
||||
private static final Logger LOG = Logger.getInstance(CheckRegExpForm.class);
|
||||
|
||||
public static final Key<Boolean> CHECK_REG_EXP_EDITOR = Key.create("CHECK_REG_EXP_EDITOR");
|
||||
|
||||
private static final Key<List<RegExpMatch>> LATEST_MATCHES = Key.create("REG_EXP_LATEST_MATCHES");
|
||||
private static final Key<RegExpMatchResult> RESULT = Key.create("REG_EXP_RESULT");
|
||||
|
||||
/**
|
||||
* @deprecated Use {{@link Keys#CHECK_REG_EXP_EDITOR} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final Key<Boolean> CHECK_REG_EXP_EDITOR = Keys.CHECK_REG_EXP_EDITOR;
|
||||
|
||||
public static final class Keys {
|
||||
// do not load CheckRegExpForm early, declare this key in separate class
|
||||
public static final Key<Boolean> CHECK_REG_EXP_EDITOR = Key.create("CHECK_REG_EXP_EDITOR");
|
||||
}
|
||||
|
||||
private static final String LAST_EDITED_REGEXP = "last.edited.regexp";
|
||||
|
||||
private final EditorTextField myRegExp;
|
||||
@@ -124,7 +133,7 @@ public final class CheckRegExpForm {
|
||||
@Override
|
||||
protected @NotNull EditorEx createEditor() {
|
||||
final EditorEx editor = super.createEditor();
|
||||
editor.putUserData(CHECK_REG_EXP_EDITOR, Boolean.TRUE);
|
||||
editor.putUserData(Keys.CHECK_REG_EXP_EDITOR, Boolean.TRUE);
|
||||
editor.putUserData(IncrementalFindAction.SEARCH_DISABLED, Boolean.TRUE);
|
||||
editor.setEmbeddedIntoDialogWrapper(true);
|
||||
return editor;
|
||||
|
||||
@@ -29,7 +29,7 @@ final class CheckRegExpIntentionAction extends QuickEditAction implements Iconab
|
||||
return false;
|
||||
}
|
||||
|
||||
if (editor.getUserData(CheckRegExpForm.CHECK_REG_EXP_EDITOR) != null) {
|
||||
if (editor.getUserData(CheckRegExpForm.Keys.CHECK_REG_EXP_EDITOR) != null) {
|
||||
// to disable intention inside CheckRegExpForm itself
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user