|
@@ -383,17 +383,24 @@ class ConsoleContent extends Widget {
|
|
|
protected onEdgeRequest(editor: ICellEditorWidget, location: EdgeLocation): void {
|
|
|
let prompt = this.prompt;
|
|
|
if (location === 'top') {
|
|
|
- this._history.back().then(value => {
|
|
|
+ this._history.back(prompt.model.source).then(value => {
|
|
|
if (!value) {
|
|
|
return;
|
|
|
}
|
|
|
+ if (prompt.model.source === value) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this._setByHistory = true;
|
|
|
prompt.model.source = value;
|
|
|
prompt.editor.setCursorPosition(0);
|
|
|
});
|
|
|
} else {
|
|
|
- this._history.forward().then(value => {
|
|
|
- // If at the bottom end of history, then clear the prompt.
|
|
|
- let text = value || '';
|
|
|
+ this._history.forward(prompt.model.source).then(value => {
|
|
|
+ let text = value || this._history.placeholder;
|
|
|
+ if (prompt.model.source === text) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this._setByHistory = true;
|
|
|
prompt.model.source = text;
|
|
|
prompt.editor.setCursorPosition(text.length);
|
|
|
});
|
|
@@ -552,6 +559,7 @@ class ConsoleContent extends Widget {
|
|
|
private _renderer: ConsoleContent.IRenderer = null;
|
|
|
private _history: IConsoleHistory = null;
|
|
|
private _session: ISession = null;
|
|
|
+ private _setByHistory = false;
|
|
|
private _foreignCells: { [key: string]: CodeCellWidget; } = {};
|
|
|
}
|
|
|
|