IDEA-184710 No undo (Ctrl+Z) possible in the "Evaluate Expression" edit field after pressing "Evaluate"

This commit is contained in:
Egor Ushakov
2018-02-14 19:54:33 +03:00
parent 1726c0dbee
commit feab419d03
@@ -1,6 +1,4 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.xdebugger.impl.ui;
import com.intellij.openapi.editor.Document;
@@ -102,18 +100,12 @@ public class XDebuggerExpressionComboBox extends XDebuggerEditorBase {
}
private void fillComboBox() {
myModel.setSelectedItem(null); // must do this to preserve current editor
myModel.replaceAll(getRecentExpressions());
if (myComboBox.getItemCount() > 0) {
myComboBox.setSelectedIndex(0);
}
}
@Override
protected void doSetText(XExpression text) {
if (myComboBox.getItemCount() > 0) {
myComboBox.setSelectedIndex(0);
}
//if (myComboBox.isEditable()) {
myEditor.setItem(text);
//}
@@ -189,11 +181,10 @@ public class XDebuggerExpressionComboBox extends XDebuggerEditorBase {
@Override
public void setItem(Object anObject) {
if (anObject == null) {
anObject = XExpressionImpl.EMPTY_EXPRESSION;
if (anObject != null) { // do not reset the editor on null
XExpression expression = (XExpression)anObject;
myDelegate.getEditorComponent().setNewDocumentAndFileType(getFileType(expression), createDocument(expression));
}
XExpression expression = (XExpression)anObject;
myDelegate.getEditorComponent().setNewDocumentAndFileType(getFileType(expression), createDocument(expression));
}
@Override