浏览代码

Clear cells in notebook handler

Jeremy Tuloup 5 年之前
父节点
当前提交
34b4c7de4d
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      src/handlers/notebook.ts

+ 5 - 4
src/handlers/notebook.ts

@@ -72,16 +72,17 @@ export class NotebookHandler implements IDisposable {
   }
 
   private showCurrentLine(frame: Callstack.IFrame) {
-    if (!frame) {
-      return;
-    }
-
     const notebook = this.notebookTracker.currentWidget;
     if (!notebook) {
       return;
     }
 
     const cells = notebook.content.widgets;
+    cells.forEach(cell => CellManager.cleanupHighlight(cell));
+
+    if (!frame) {
+      return;
+    }
 
     cells.forEach(cell => {
       // check the event is for the correct cell