Skip to content

Commit 0913c2e

Browse files
authored
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.
1 parent fb12524 commit 0913c2e

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/line_cursor.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ export class LineCursor extends Marker {
4444
}
4545
let newNode = this.getNextNode(curNode, this.validLineNode);
4646

47-
// Skip the input (but not next) connection if there is a connected block.
48-
if (
49-
newNode &&
50-
newNode.getType() === ASTNode.types.INPUT &&
51-
(newNode.getLocation() as Blockly.Connection).targetBlock()
52-
) {
53-
newNode = this.getNextNode(newNode, this.validLineNode);
54-
}
5547
if (newNode) {
5648
this.setCurNode(newNode);
5749
}
@@ -91,15 +83,6 @@ export class LineCursor extends Marker {
9183
}
9284
let newNode = this.getPreviousNode(curNode, this.validLineNode);
9385

94-
// Skip the input (but not next) connection if there is a connected block.
95-
if (
96-
newNode &&
97-
newNode.getType() == ASTNode.types.INPUT &&
98-
(newNode.getLocation() as Blockly.Connection).targetBlock()
99-
) {
100-
newNode = this.getPreviousNode(newNode, this.validLineNode);
101-
}
102-
10386
if (newNode) {
10487
this.setCurNode(newNode);
10588
}

0 commit comments

Comments
 (0)