goto action: do not use editor selection for initial text (IDEA-83914): allow to ignore according to a parameter

This commit is contained in:
anna
2012-04-02 16:34:59 +02:00
parent 69344c357c
commit 63ba4af884
@@ -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);
}
}
}