Skip to content

Commit

Permalink
fix: Allow line cursor next/prev to visit connected inputs (#114)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cpcallen authored Nov 11, 2024
1 parent fb12524 commit 0913c2e
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/line_cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 0913c2e

Please sign in to comment.