IDEA-158467 Do not get selected text if selection is not changed

This commit is contained in:
Vitaliy.Bibaev
2017-07-04 13:12:01 +03:00
parent 63a089ebcb
commit 6194fa7849
@@ -205,13 +205,15 @@ public abstract class XVariablesViewBase extends XDebugView {
@Override
public void selectionChanged(final SelectionEvent e) {
if (!Registry.is("debugger.valueTooltipAutoShowOnSelection") || myEditor.getCaretModel().getCaretCount() > 1) {
if (!Registry.is("debugger.valueTooltipAutoShowOnSelection") ||
myEditor.getCaretModel().getCaretCount() > 1 ||
e.getNewRanges().length != 1 ||
!Objects.equals(e.getNewRange(), e.getOldRange())) {
return;
}
final String text = myEditor.getDocument().getText(e.getNewRange()).trim();
final boolean isSelectionChanged = e.getNewRanges().length == 1 && !Objects.equals(e.getNewRange(), e.getOldRange());
if (isSelectionChanged && !IGNORED_TEXTS.contains(text) && SIDE_EFFECT_PRODUCERS.stream().noneMatch(text::contains)) {
if (IGNORED_TEXTS.contains(text) && SIDE_EFFECT_PRODUCERS.stream().noneMatch(text::contains)) {
final XDebugSession session = getSession(myTreePanel.getTree());
if (session == null) return;
XDebuggerEvaluator evaluator = myStackFrame.getEvaluator();