Przeglądaj źródła

Add support for %load in the console

Steven Silvester 8 lat temu
rodzic
commit
2c2a11d6d2
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10 0
      src/console/widget.ts

+ 10 - 0
src/console/widget.ts

@@ -221,6 +221,16 @@ class ConsoleWidget extends Widget {
         if (value.content.status === 'ok') {
           let content = value.content as KernelMessage.IExecuteOkReply;
           this._inspectionHandler.handleExecuteReply(content);
+          // Use deprecated payloads for backwards compatibility.
+          if (content.payload) {
+            let setNextInput = content.payload.filter(i => {
+              return (i as any).source === 'set_next_input';
+            })[0];
+            if (setNextInput) {
+              let text = (setNextInput as any).text;
+              this.prompt.model.source = text;
+            }
+          }
         }
         Private.scrollToBottom(this.node);
       },