From 90885ba3cc182272fdb9baec37c19eefa27a5a79 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 12 Apr 2024 09:54:14 +0200 Subject: [PATCH] Make pairs, rather than block mappings, foldable FIX: Make block mapping entries, rather than the entire mapping, foldable. See https://discuss.codemirror.net/t/folding-issues-with-lang-yaml-and-or-lezer-yaml-blockmapping/8111 --- src/yaml.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yaml.ts b/src/yaml.ts index 7953c9e..d21285d 100644 --- a/src/yaml.ts +++ b/src/yaml.ts @@ -37,7 +37,7 @@ export const yamlLanguage = LRLanguage.define({ }), foldNodeProp.add({ "FlowMapping FlowSequence": foldInside, - "BlockSequence BlockMapping BlockLiteral": + "BlockSequence Pair BlockLiteral": (node, state) => ({from: state.doc.lineAt(node.from).to, to: node.to}) }) ]