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

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

[nongnu] elpa/yaml-mode 97a58b3 109/124: Make sure not to pre-fill ppss


From: ELPA Syncer
Subject: [nongnu] elpa/yaml-mode 97a58b3 109/124: Make sure not to pre-fill ppss cache with wrong entries
Date: Sun, 29 Aug 2021 11:36:23 -0400 (EDT)

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

    Make sure not to pre-fill ppss cache with wrong entries
---
 yaml-mode.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/yaml-mode.el b/yaml-mode.el
index 7c25cf2..ede67f9 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -266,9 +266,9 @@ that key is pressed to begin a block literal."
       (when (get-text-property (point) 'yaml-block-literal)
         (put-text-property (1- (point)) (point)
                            'syntax-table (string-to-syntax "w")))
-      (let ((sps (syntax-ppss))
-            (pt (point)))
-        (when (nth 3 sps)
+      (let* ((pt (point))
+             (sps (save-excursion (syntax-ppss (1- pt)))))
+        (when (not (nth 8 sps))
           (cond
            ((and (char-equal ?' (char-before (1- pt)))
                  (char-equal ?' (char-before pt)))
@@ -283,7 +283,7 @@ that key is pressed to begin a block literal."
            (t
             ;; We're right after a quote that opens a string literal.
             ;; Skip over it (big speedup for long JSON strings).
-            (goto-char (nth 8 sps))
+            (goto-char (1- pt))
             (ignore-errors (forward-sexp)))))))))
 
 (defun yaml-font-lock-block-literals (bound)



reply via email to

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