emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/yaml-mode 68fecb5 118/124: Exclude newline from `yaml-nest


From: ELPA Syncer
Subject: [nongnu] elpa/yaml-mode 68fecb5 118/124: Exclude newline from `yaml-nested-map-re`
Date: Sun, 29 Aug 2021 11:36:25 -0400 (EDT)

branch: elpa/yaml-mode
commit 68fecb5f0dec712a10c8655df6881392a4613617
Author: Vasilij Schneidermann <mail@vasilij.de>
Commit: Vasilij Schneidermann <mail@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\\|\\'\\)"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]