[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/yaml 39f8412bec 079/124: Fix encoding deeply nested lis
From: |
ELPA Syncer |
Subject: |
[elpa] externals/yaml 39f8412bec 079/124: Fix encoding deeply nested lists |
Date: |
Fri, 29 Nov 2024 16:00:04 -0500 (EST) |
branch: externals/yaml
commit 39f8412becebf39974bce1b5c90220c89f7ebacc
Author: Zachary Romero <zacromero@posteo.net>
Commit: Zachary Romero <zacromero@posteo.net>
Fix encoding deeply nested lists
---
yaml-tests.el | 8 ++++++++
yaml.el | 8 ++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/yaml-tests.el b/yaml-tests.el
index 6993986b7c..2e323be7da 100644
--- a/yaml-tests.el
+++ b/yaml-tests.el
@@ -546,6 +546,14 @@ keep: |+
(should (equal
(yaml-encode `((deeper . [((foo . bar) (baz . bax))])))
"\ndeeper: \n- foo: bar\n baz: bax"))
+ (should (equal
+ (equal (yaml-parse-string
+ (yaml-encode [1 [2 [3] 2] 1])
+ :object-type 'alist
+ :sequence-type 'array)
+ [[1 [2 [3] 2] 1]])))
+ (should (equal
+ (yaml-test-round-trip `[1 [2 [[4 4 4] 3 ((a . 1) (b . 2) (c . 3))
3] 2] 1])))
(should (yaml-test-round-trip
'((build_the_package (script . "if [ -z \"${CUSTOM}\" ]; then
./mvnw package
diff --git a/yaml.el b/yaml.el
index 718e111c97..f0a38eda53 100644
--- a/yaml.el
+++ b/yaml.el
@@ -2800,10 +2800,10 @@ auto-detecting the indentation"
(insert (make-string (- indent curr-indent) ?\s) "-
"))
(insert "\n" indent-string "- "))
(setq first nil))
- (yaml--encode-object object indent
- (or
- (hash-table-p object)
- (yaml--alist-to-hash-table object))))
+ (if (or (hash-table-p object)
+ (yaml--alist-to-hash-table object))
+ (yaml--encode-object object indent t)
+ (yaml--encode-object object (+ indent 2) nil)))
l))))))
(defun yaml--encode-auto-detect-indent ()
- [elpa] externals/yaml 604774d385 117/124: Add documentation on running tests, (continued)
- [elpa] externals/yaml 604774d385 117/124: Add documentation on running tests, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 7c4b2ec9a5 116/124: Merge pull request #49 from zkry/48-encode-remove-leading-newlines, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 708dd886a2 001/124: Initial commit, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 8771e68930 004/124: Got key-value working, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml afdb23754a 024/124: Fix folding string parsing, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 2e2e7d199e 023/124: Implement anchor alias resolution, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 8101f2c1fa 030/124: Add import statement; remove debug messages, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 84b88c9ed1 073/124: Merge pull request #27 from zkry/fix-empty-single-quote-string, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml b6091cc080 077/124: add unit test case, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml cb1cc42bd1 093/124: Merge pull request #36 from zkry/fix-string-values-state-bug, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 39f8412bec 079/124: Fix encoding deeply nested lists,
ELPA Syncer <=
- [elpa] externals/yaml 25f35c80e4 035/124: Replace string-trim-right with replace-regexp-in-string, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 1304802f9f 069/124: Reduce the max line length to be under 80 characters., ELPA Syncer, 2024/11/29
- [elpa] externals/yaml f8803066ae 085/124: Merge pull request #33 from zkry/add-position-information-to-parse-tree, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 7ef2e8ce5b 100/124: fix unit tests, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 368452c534 064/124: Add test case for issue, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml d82bfb523e 059/124: fix testcases, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml af49540f53 107/124: Use cl-defun &key to allow eldoc argument hints to work better, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 01a12f2345 118/124: Merge pull request #50 from rdrg109/master, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml fe08b8f530 120/124: Merge pull request #52 from zkry/51-fix-failing-test, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml a19fbf948a 112/124: Merge pull request #46 from zkry/45-fix-char-escape, ELPA Syncer, 2024/11/29