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

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

[nongnu] elpa/yaml-mode add6156 113/124: yaml-mode-syntax-propertize-fun


From: ELPA Syncer
Subject: [nongnu] elpa/yaml-mode add6156 113/124: yaml-mode-syntax-propertize-function: Clear ppss cache
Date: Sun, 29 Aug 2021 11:36:24 -0400 (EDT)

branch: elpa/yaml-mode
commit add6156a652003b3910752d996759387c0c07135
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    yaml-mode-syntax-propertize-function: Clear ppss cache
    
    In the one case where we still end up making it invalid.
    
    No problem examples (haven't managed to trigger one), but this is the
    "correct" thing to do.
---
 yaml-mode.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/yaml-mode.el b/yaml-mode.el
index 6bd4000..3da7293 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -273,7 +273,11 @@ that key is pressed to begin a block literal."
            ((and (char-equal ?' (char-before (1- pt)))
                  (char-equal ?' (char-before pt)))
             (put-text-property (- pt 2) pt
-                               'syntax-table (string-to-syntax "w")))
+                               'syntax-table (string-to-syntax "w"))
+            ;; Workaround for an infloop bug.
+            (let ((syntax-propertize--done syntax-propertize--done))
+              ;; Carefully invalidate the last cached ppss.
+              (syntax-ppss-flush-cache (- pt 2))))
            ;; If quote is detected as a syntactic string start but appeared
            ;; after a non-whitespace character, then mark it as syntactic word.
            ((and (char-before (1- pt))



reply via email to

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