Browse Source

resolve hover issue in console and editor error

Borys Palka 5 năm trước cách đây
mục cha
commit
d4ffc8b2a7
2 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 4 1
      src/handlers/cell.ts
  2. 3 1
      style/breakpoints.css

+ 4 - 1
src/handlers/cell.ts

@@ -73,7 +73,7 @@ export class CellManager implements IDisposable {
 
   // TODO: call when the debugger stops
   private cleanupHighlight() {
-    if (!this.activeCell) {
+    if (!this.activeCell || this.activeCell.disposed) {
       return;
     }
     const editor = this.activeCell.editor as CodeMirrorEditor;
@@ -169,6 +169,9 @@ export class CellManager implements IDisposable {
   }
 
   protected removeListener(cell: CodeCell) {
+    if (cell.disposed) {
+      return;
+    }
     const editor = cell.editor as CodeMirrorEditor;
     editor.editor.off('gutterClick', this.onGutterClick);
     editor.editor.off('renderLine', this.onNewRenderLine);

+ 3 - 1
style/breakpoints.css

@@ -28,6 +28,8 @@
 }
 
 .jp-CodeCell.jp-mod-selected .CodeMirror-gutter-wrapper:hover::after,
-.jp-Editor.jp-mod-focused .CodeMirror-gutter-wrapper:hover::after {
+.jp-Editor.jp-mod-focused
+  .CodeMirror:not(.jp-mod-readOnly)
+  .CodeMirror-gutter-wrapper:hover::after {
   opacity: 0.5;
 }