branch: elpa/yaml-mode
commit add6156a652003b3910752d996759387c0c07135
Author: Dmitry Gutov <dgu...@yandex.ru>
Commit: Dmitry Gutov <dgu...@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