Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Commit 9bf24c8

Browse files
committed
Fold statements from the end of their first line, not first token
FIX: Make statement folding leave the entire first line visible. See https://discuss.codemirror.net/t/configure-code-folding-to-preserve-first-line/8178
1 parent 176496f commit 9bf24c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/sql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let parser = baseParser.configure({
1212
Statement: continuedIndent()
1313
}),
1414
foldNodeProp.add({
15-
Statement(tree) { return {from: tree.firstChild!.to, to: tree.to} },
15+
Statement(tree, state) { return {from: Math.min(tree.from + 100, state.doc.lineAt(tree.from).to), to: tree.to} },
1616
BlockComment(tree) { return {from: tree.from + 2, to: tree.to - 2} }
1717
}),
1818
styleTags({

0 commit comments

Comments
 (0)