10000 Allow selectParentSyntax to select children of the top node · codemirror/commands@0b78575 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b78575

Browse files
committed
Allow selectParentSyntax to select children of the top node
FIX: Fix an issue causing `selectParentSyntax` to not select syntax that is a direct child of the top node. Closes codemirror/dev#1436
1 parent 58a5c3d commit 0b78575

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export const selectParentSyntax: StateCommand = ({state, dispatch}) => {
406406
let {node} = cur
407407
if (((node.from < range.from && node.to >= range.to) ||
408408
(node.to > range.to && node.from <= range.from)) &&
409-
node.parent?.parent)
409+
cur.next)
410410
return EditorSelection.range(node.to, node.from)
411411
}
412412
return range

0 commit comments

Comments
 (0)
0