|
@@ -539,21 +539,21 @@ class ConsoleWidget extends Widget {
|
|
|
* Handle an edge requested signal.
|
|
|
*/
|
|
|
protected onEdgeRequest(editor: CellEditorWidget, location: EdgeLocation): void {
|
|
|
- let doc = editor.editor.getDoc();
|
|
|
+ let prompt = this.prompt;
|
|
|
if (location === 'top') {
|
|
|
this._history.back().then(value => {
|
|
|
if (!value) {
|
|
|
return;
|
|
|
}
|
|
|
- doc.setValue(value);
|
|
|
- doc.setCursor(doc.posFromIndex(0));
|
|
|
+ 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 || '';
|
|
|
- doc.setValue(text);
|
|
|
- doc.setCursor(doc.posFromIndex(text.length));
|
|
|
+ prompt.model.source = text;
|
|
|
+ prompt.editor.setCursorPosition(text.length);
|
|
|
});
|
|
|
}
|
|
|
}
|