Преглед на файлове

Bugfix: console history submission without an edit to text entiered by history was broken.

A. Darian преди 9 години
родител
ревизия
b49f3cdd73
променени са 1 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 5 5
      src/console/widget.ts

+ 5 - 5
src/console/widget.ts

@@ -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);
       });
     }
   }