branch: elpa/yaml-mode commit 04c30eabb56f704a5e3902c47960029487d8abc6 Author: Ben Strutt <ben.stru...@nhs.net> Commit: Ben Strutt <ben.stru...@nhs.net>
Fix propertization for lists of dicts with literal block previously_broken_but_now_correct: - bash: | echo "Properties following this block were broken" displayName: "Incorrectly propertized with face 'yaml-block-literal" --- ...yntax-highlighting-list-of-dicts-containing-literal-block.yaml | 8 ++++++++ yaml-mode.el | 2 ++ 2 files changed, 10 insertions(+) diff --git a/test-files/test-syntax-highlighting-list-of-dicts-containing-literal-block.yaml b/test-files/test-syntax-highlighting-list-of-dicts-containing-literal-block.yaml new file mode 100644 index 0000000..2682f14 --- /dev/null +++ b/test-files/test-syntax-highlighting-list-of-dicts-containing-literal-block.yaml @@ -0,0 +1,8 @@ +# Propertized incorrectly prior to PR +example: + - key1: Correctly propertized + key2: | + Correctly propertized. + - key3: | + Correctly propertized + key4: Incorrectly propertized as part of preceding yaml-literal-block diff --git a/yaml-mode.el b/yaml-mode.el index cb86652..97ddff3 100644 --- a/yaml-mode.el +++ b/yaml-mode.el @@ -322,6 +322,8 @@ artificially limited to the value of (unless (looking-at yaml-blank-line-re) (setq min-level (min min-level (current-indentation)))) (forward-line -1)) + (when (looking-at-p " *- ") + (setq min-level (- min-level 2))) (cond ((and (< (current-indentation) min-level) (looking-at yaml-block-literal-re))