Ver código fonte

Clear cell editor history after loading the model

Steven Silvester 8 anos atrás
pai
commit
87e1e76dd0
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7 0
      src/notebook/panel.ts

+ 7 - 0
src/notebook/panel.ts

@@ -5,6 +5,10 @@ import {
   Kernel, KernelMessage
 } from '@jupyterlab/services';
 
+import {
+  each
+} from 'phosphor/lib/algorithm/iteration';
+
 import {
   Message
 } from 'phosphor/lib/core/messaging';
@@ -269,6 +273,9 @@ class NotebookPanel extends Widget {
         // Clear the undo state of the cells.
         if (model) {
           model.cells.clearUndo();
+          each(this.notebook.widgets, widget => {
+            widget.editor.clearHistory();
+          });
         }
       });
     }