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

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

[elpa] externals/yaml fdc65922c9 099/124: fix zero-column indent problem


From: ELPA Syncer
Subject: [elpa] externals/yaml fdc65922c9 099/124: fix zero-column indent problems; add more unit tests
Date: Fri, 29 Nov 2024 16:00:08 -0500 (EST)

branch: externals/yaml
commit fdc65922c9a5d9a661b9957b7e39e64415580ad3
Author: Zachary Romero <zacromero@posteo.net>
Commit: Zachary Romero <zacromero@posteo.net>

    fix zero-column indent problems; add more unit tests
---
 yaml-tests.el | 11 ++++++++++-
 yaml.el       |  2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/yaml-tests.el b/yaml-tests.el
index 1421a07aac..9498a337db 100644
--- a/yaml-tests.el
+++ b/yaml-tests.el
@@ -408,7 +408,16 @@ ship-to:
                  '((deeply (nested (value . " test string"))))))
   (should (equal (yaml-parse-string "deeply:\n  nested:\n    value: |-\n       
    test string"
                                     :object-type 'alist)
-                 '((deeply (nested (value . "test string")))))))
+                 '((deeply (nested (value . "test string"))))))
+  (should (equal (yaml-parse-string ">-\n this is text"
+                                    :object-type 'alist)
+                 "this is text"))
+  (should (equal (yaml-parse-string ">-1\n this is text"
+                                    :object-type 'alist)
+                 "this is text"))
+  (should (equal (yaml-parse-string "top: |1\n  this is text"
+                                    :object-type 'alist)
+                 '((top . " this is text\n")))))
 
 (ert-deftest yaml-parsing-completes ()
   "Tests that the yaml parses."
diff --git a/yaml.el b/yaml.el
index 18447416fb..169cf8f4b4 100644
--- a/yaml.el
+++ b/yaml.el
@@ -768,7 +768,7 @@ repeat for each character in a text.")
                                        (cons (1+ beg)
                                              (1+ yaml--parsing-position)))))
                (when (member ,name '("c-l+folded" "c-l+literal"))
-                 (setq str (propertize str 'yaml-n n)))
+                 (setq str (propertize str 'yaml-n (max 0 n))))
                (list ,name
                      (if yaml--parsing-store-position
                          (propertize str 'yaml-position (cons (1+ beg)



reply via email to

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