Does not include the end position of a block in findChildNodeAt()

This commit is contained in:
Volker Berlin 2022-05-27 21:42:09 +02:00
parent bf58d2968a
commit d46050a3a3
No known key found for this signature in database
GPG Key ID: 988423EF815BE4CB

View File

@ -739,7 +739,8 @@ class BranchManager {
@Nonnull
private BranchNode findChildNodeAt( @Nonnull BranchNode parent, int codePosition ) {
for( BranchNode node : parent ) {
if( node.startPos <= codePosition && codePosition <= node.endPos ) {
// the end position of a block is position of the first instruction outside of the block
if( node.startPos <= codePosition && codePosition < node.endPos ) {
return findChildNodeAt( node, codePosition );
}
}