8000 Add code folding for multi-line strings · codemirror/lang-python@3049f47 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3049f47

Browse files
committed
Add code folding for multi-line strings
FEATURE: Allow multi-line strings to be code-folded. Closes codemirror/dev#1551
1 parent 3930ddf commit 3049f47

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/python.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ export const pythonLanguage = LRLanguage.define({
8585

8686
foldNodeProp.add({
8787
"ArrayExpression DictionaryExpression SetExpression TupleExpression": foldInside,
88-
Body: (node, state) => ({from: node.from + 1, to: node.to - (node.to == state.doc.length ? 0 : 1)})
88+
Body: (node, state) => ({from: node.from + 1, to: node.to - (node.to == state.doc.length ? 0 : 1)}),
89+
"String FormatString": (node, state) => ({from: state.doc.lineAt(node.from).to, to: node.to})
8990
})
9091
],
9192
}),

0 commit comments

Comments
 (0)
0