branch: elpa/yaml-mode commit 68fecb5f0dec712a10c8655df6881392a4613617 Author: Vasilij Schneidermann <m...@vasilij.de> Commit: Vasilij Schneidermann <m...@vasilij.de>
Exclude newline from `yaml-nested-map-re` --- test-files/test-nested-map-single-line-match.yaml | 6 ++++++ yaml-mode.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test-files/test-nested-map-single-line-match.yaml b/test-files/test-nested-map-single-line-match.yaml new file mode 100644 index 0000000..1465344 --- /dev/null +++ b/test-files/test-nested-map-single-line-match.yaml @@ -0,0 +1,6 @@ +# indent on line "bar: baz" should not go deeper than "foo: bar" +a: + foo: bar + bar: baz +b: + 1 diff --git a/yaml-mode.el b/yaml-mode.el index 4914218..cb86652 100644 --- a/yaml-mode.el +++ b/yaml-mode.el @@ -151,7 +151,7 @@ that key is pressed to begin a block literal." "Regexp indicating the beginning of a scalar context.") (defconst yaml-nested-map-re - (concat "[^#]*: *\\(?:&.*\\|{ *\\|" yaml-tag-re " *\\)?$") + (concat "[^#\n]*: *\\(?:&.*\\|{ *\\|" yaml-tag-re " *\\)?$") "Regexp matching a line beginning a YAML nested structure.") (defconst yaml-block-literal-base-re " *[>|][-+0-9]* *\\(?:\n\\|\\'\\)"