From 63ba4af884026d9627ca19041cd5cd13c7d74180 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 2 Apr 2012 15:20:36 +0200 Subject: [PATCH] goto action: do not use editor selection for initial text (IDEA-83914): allow to ignore according to a parameter --- .../src/com/intellij/ide/actions/GotoActionBase.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/GotoActionBase.java b/platform/lang-impl/src/com/intellij/ide/actions/GotoActionBase.java index f7586f8ce300..28e9fb53427d 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/GotoActionBase.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/GotoActionBase.java @@ -110,11 +110,13 @@ public abstract class GotoActionBase extends AnAction { } protected static Pair 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); + } } }