mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
goto action: do not use editor selection for initial text (IDEA-83914): allow to ignore according to a parameter
This commit is contained in:
@@ -110,11 +110,13 @@ public abstract class GotoActionBase extends AnAction {
|
||||
}
|
||||
|
||||
protected static Pair<String, Integer> getInitialText(boolean useEditorSelection, AnActionEvent e) {
|
||||
final Editor editor = e.getData(PlatformDataKeys.EDITOR);
|
||||
if (editor != null) {
|
||||
final String selectedText = editor.getSelectionModel().getSelectedText();
|
||||
if (selectedText != null && !selectedText.contains("\n")) {
|
||||
return Pair.create(selectedText, 0);
|
||||
if (useEditorSelection) {
|
||||
final Editor editor = e.getData(PlatformDataKeys.EDITOR);
|
||||
if (editor != null) {
|
||||
final String selectedText = editor.getSelectionModel().getSelectedText();
|
||||
if (selectedText != null && !selectedText.contains("\n")) {
|
||||
return Pair.create(selectedText, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user