branch: externals/yaml
commit 3f1be7640b1d368f2115789e589f7945806e4462
Author: ergopractice <[email protected]>
Commit: ergopractice <[email protected]>
Add control for encoding scalars as flow sequences
---
yaml.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/yaml.el b/yaml.el
index fe3c42f277..ae6084fd3d 100644
--- a/yaml.el
+++ b/yaml.el
@@ -45,6 +45,9 @@
(defconst yaml-parser-version "0.5.1")
+(defvar yaml--encode-use-flow-sequence t
+ "Turn on encoding sequence of scalars as flow sequence.")
+
(defvar yaml--parse-debug nil
"Turn on debugging messages when parsing YAML when non-nil.
@@ -2672,7 +2675,8 @@ auto-detecting the indentation"
(yaml--encode-hash-table ht indent auto-indent))
((zerop (length l))
(insert "[]"))
- ((seq-every-p #'yaml--scalarp l)
+ ((and yaml--encode-use-flow-sequence
+ (seq-every-p #'yaml--scalarp l))
(insert "[")
(yaml--encode-object (car l) 0)
(seq-do (lambda (object)