]> git.eshelyaron.com Git - sweep.git/commitdiff
Do not highlight other occurrences of anonymous variables
authorEshel Yaron <me@eshelyaron.com>
Fri, 25 Nov 2022 10:44:47 +0000 (12:44 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 25 Nov 2022 10:44:47 +0000 (12:44 +0200)
* sweeprolog.el (sweeprolog-analyze-fragment-variable): check for
anonymous variables ("_").

sweeprolog.el

index 32642997affb26f48b97de366c934e7da0e4d69e..94ccb26072a380d2eb853e5aeea932cf14ff71f0 100644 (file)
@@ -2089,9 +2089,11 @@ resulting list even when found in the current clause."
     ((or "var"
          `("goal_term" "meta" variable 0))
      (let ((var (buffer-substring-no-properties beg end)))
-       (with-silent-modifications
-         (put-text-property beg end 'cursor-sensor-functions
-                            (sweeprolog-cursor-sensor-functions var)))))))
+       (unless (string= var "_")
+         (with-silent-modifications
+           (put-text-property beg end 'cursor-sensor-functions
+                              (sweeprolog-cursor-sensor-functions
+                               var))))))))
 
 (defvar sweeprolog-analyze-region-start-hook
   '(sweeprolog-analyze-start-font-lock))