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

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

[nongnu] elpa/rainbow-delimiters 5ab3135986 061/188: Fix a bug that caus


From: ELPA Syncer
Subject: [nongnu] elpa/rainbow-delimiters 5ab3135986 061/188: Fix a bug that caused (rainbow-delimiters-syntax-ppss 1) to return nil.
Date: Sat, 1 Jan 2022 00:58:52 -0500 (EST)

branch: elpa/rainbow-delimiters
commit 5ab3135986fc40d9fa6c51f9e093c934e4f9f31e
Author: Fanael Linithien <fanael4@gmail.com>
Commit: Fanael Linithien <fanael4@gmail.com>

    Fix a bug that caused (rainbow-delimiters-syntax-ppss 1) to return nil.
---
 rainbow-delimiters.el | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/rainbow-delimiters.el b/rainbow-delimiters.el
index b8ded8a84a..b4f513f52f 100644
--- a/rainbow-delimiters.el
+++ b/rainbow-delimiters.el
@@ -343,16 +343,18 @@ The list is ordered descending by car.")
 CACHE-NEAREST-AFTER should be a list of cache entries starting at the first
 entry after TO, or nil if there's no such entry.
 Intermediate `parse-partial-sexp' results are added to the cache."
-  (while (< from to)
-    (let ((newpos (min to (+ from 
rainbow-delimiters-parse-partial-sexp-cache-max-span))))
-      (let ((state (parse-partial-sexp from newpos nil nil oldstate)))
-        (if (/= newpos to)
-            (if cache-nearest-after
-                (push (cons newpos state) (cdr cache-nearest-after))
-              (push (cons newpos state) 
rainbow-delimiters-parse-partial-sexp-cache)))
-        (setq oldstate state
-              from newpos))))
-  oldstate)
+  (if (= from to)
+      (parse-partial-sexp from to nil nil oldstate)
+    (while (< from to)
+      (let ((newpos (min to (+ from 
rainbow-delimiters-parse-partial-sexp-cache-max-span))))
+        (let ((state (parse-partial-sexp from newpos nil nil oldstate)))
+          (if (/= newpos to)
+              (if cache-nearest-after
+                  (push (cons newpos state) (cdr cache-nearest-after))
+                (push (cons newpos state) 
rainbow-delimiters-parse-partial-sexp-cache)))
+          (setq oldstate state
+                from newpos))))
+    oldstate))
 
 (defsubst rainbow-delimiters-syntax-ppss (pos)
   "Parse-Partial-Sexp State at POS, defaulting to point.



reply via email to

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