소스 검색

Add support for %load in the console

Steven Silvester 8 년 전
부모
커밋
2c2a11d6d2
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  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);
       },