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

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

[nongnu] elpa/yaml-mode 41adb32 112/124: Merge pull request #77 from dgu


From: ELPA Syncer
Subject: [nongnu] elpa/yaml-mode 41adb32 112/124: Merge pull request #77 from dgutov/single-quote-fixup
Date: Sun, 29 Aug 2021 11:36:24 -0400 (EDT)

branch: elpa/yaml-mode
commit 41adb32b886352827c4d4b4ad15cdf18a00c8c50
Merge: 9e8362d ed7ec2e
Author: Vasilij Schneidermann <mail@vasilij.de>
Commit: GitHub <noreply@github.com>

    Merge pull request #77 from dgutov/single-quote-fixup
    
    Don't freeze on unclosed strings
---
 test-files/test-quotes-in-strings.yaml | 1 +
 yaml-mode.el                           | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/test-files/test-quotes-in-strings.yaml 
b/test-files/test-quotes-in-strings.yaml
index 5859bbd..07137a9 100644
--- a/test-files/test-quotes-in-strings.yaml
+++ b/test-files/test-quotes-in-strings.yaml
@@ -3,3 +3,4 @@ some's'strings'some's'nots:
 - this: 'is a string with "quotes"'
 - and: 'to express one single quote, use '' two of them'
 - finally: syntax is not string
+- singlequotedoesntfreeze: '
diff --git a/yaml-mode.el b/yaml-mode.el
index 66e41b3..6bd4000 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -284,7 +284,10 @@ that key is pressed to begin a block literal."
             ;; We're right after a quote that opens a string literal.
             ;; Skip over it (big speedup for long JSON strings).
             (goto-char (1- pt))
-            (ignore-errors (forward-sexp)))))))))
+            (condition-case nil
+                (forward-sexp)
+              (scan-error
+               (goto-char end))))))))))
 
 (defun yaml-font-lock-block-literals (bound)
   "Find lines within block literals.



reply via email to

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