From 0913c2e9132ec72bb948cb44d1ad244068750ee9 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Mon, 11 Nov 2024 17:27:12 +0000 Subject: [PATCH] fix: Allow line cursor next/prev to visit connected inputs (#114) Allow the next/prev methods on LineCursor to visit inputs, even if the input has a block connected to it. Without this it's impossible to visit the connection between an statement input and the top block of the connected substack. Fixes #99. --- src/line_cursor.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/line_cursor.ts b/src/line_cursor.ts index 574751e..1325c22 100644 --- a/src/line_cursor.ts +++ b/src/line_cursor.ts @@ -44,14 +44,6 @@ export class LineCursor extends Marker { } let newNode = this.getNextNode(curNode, this.validLineNode); - // Skip the input (but not next) connection if there is a connected block. - if ( - newNode && - newNode.getType() === ASTNode.types.INPUT && - (newNode.getLocation() as Blockly.Connection).targetBlock() - ) { - newNode = this.getNextNode(newNode, this.validLineNode); - } if (newNode) { this.setCurNode(newNode); } @@ -91,15 +83,6 @@ export class LineCursor extends Marker { } let newNode = this.getPreviousNode(curNode, this.validLineNode); - // Skip the input (but not next) connection if there is a connected block. - if ( - newNode && - newNode.getType() == ASTNode.types.INPUT && - (newNode.getLocation() as Blockly.Connection).targetBlock() - ) { - newNode = this.getPreviousNode(newNode, this.validLineNode); - } - if (newNode) { this.setCurNode(newNode); }