summaryrefslogtreecommitdiff
path: root/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerEditorBase.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerEditorBase.java')
-rw-r--r--platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerEditorBase.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerEditorBase.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerEditorBase.java
index 991036b7f438..61a499ccf4dd 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerEditorBase.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerEditorBase.java
@@ -59,7 +59,7 @@ public abstract class XDebuggerEditorBase {
private final XDebuggerEditorsProvider myDebuggerEditorsProvider;
@NotNull private final EvaluationMode myMode;
@Nullable private final String myHistoryId;
- private final XSourcePosition mySourcePosition;
+ @Nullable private XSourcePosition mySourcePosition;
private int myHistoryIndex;
private final JLabel myChooseFactory = new JLabel();
@@ -124,6 +124,13 @@ public abstract class XDebuggerEditorBase {
return panel;
}
+ public void setSourcePosition(@Nullable XSourcePosition sourcePosition) {
+ if (mySourcePosition != sourcePosition) {
+ mySourcePosition = sourcePosition;
+ setExpression(getExpression(), false);
+ }
+ }
+
@NotNull
public EvaluationMode getMode() {
return myMode;
@@ -137,10 +144,16 @@ public abstract class XDebuggerEditorBase {
protected abstract void doSetText(XExpression text);
public void setExpression(@Nullable XExpression text) {
+ setExpression(text, true);
+ }
+
+ private void setExpression(@Nullable XExpression text, boolean saveInHistory) {
if (text == null) {
text = getMode() == EvaluationMode.EXPRESSION ? XExpressionImpl.EMPTY_EXPRESSION : XExpressionImpl.EMPTY_CODE_FRAGMENT;
}
- saveTextInHistory(text);
+ if (saveInHistory) {
+ saveTextInHistory(text);
+ }
Language language = text.getLanguage();
if (language == null) {
if (mySourcePosition != null) {