diff --git a/core/keyboard_nav/line_cursor.ts b/core/keyboard_nav/line_cursor.ts index 8cc51f903..85c0f414a 100644 --- a/core/keyboard_nav/line_cursor.ts +++ b/core/keyboard_nav/line_cursor.ts @@ -378,7 +378,7 @@ export class LineCursor extends Marker { // Ensure the current node matches what's currently focused. const focused = getFocusManager().getFocusedNode(); const block = this.getSourceBlockFromNode(focused); - if (!block || block.workspace === this.workspace) { + if (block && block.workspace === this.workspace) { // If the current focused node corresponds to a block then ensure that it // belongs to the correct workspace for this cursor. this.setCurNode(focused);