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

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

[nongnu] elpa/hideshowvis 7b174241c9 15/20: fix: Check hideshowvis-ignor


From: ELPA Syncer
Subject: [nongnu] elpa/hideshowvis 7b174241c9 15/20: fix: Check hideshowvis-ignore-same-line before making overlay.
Date: Sat, 15 Jun 2024 10:00:29 -0400 (EDT)

branch: elpa/hideshowvis
commit 7b174241c9381afb0d55c8bdc52b727323ce76bc
Author: eyal0 <109809+eyal0@users.noreply.github.com>
Commit: Jan R <nospam@sheijk.net>

    fix: Check hideshowvis-ignore-same-line before making overlay.
    
    This fixes #11.
---
 hideshowvis.el | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/hideshowvis.el b/hideshowvis.el
index d0669dce74..2b2fe80386 100644
--- a/hideshowvis.el
+++ b/hideshowvis.el
@@ -140,23 +140,21 @@ functions used with `after-change-functions'."
         (goto-char (point-min))
         (remove-overlays (point-min) (point-max) 'hideshowvis-hs t)
         (while (search-forward-regexp hs-block-start-regexp nil t)
-          (let* ((ovl (make-overlay (match-beginning 0) (match-end 0)))
-                 (marker-string "*hideshowvis*")
-                 (doit
-                  (if hideshowvis-ignore-same-line
-                      (let (begin-line)
-                        (setq begin-line
-                              (save-excursion
-                                (goto-char (match-beginning 0))
-                                (line-number-at-pos (point))))
-                        (save-excursion
-                          (goto-char (match-beginning 0))
-                          (ignore-errors
-                            (progn
-                              (funcall hs-forward-sexp-func 1)
-                              (> (line-number-at-pos (point)) begin-line)))))
-                    t)))
-            (when doit
+          (when (if hideshowvis-ignore-same-line
+                    (let (begin-line)
+                      (setq begin-line
+                            (save-excursion
+                              (goto-char (match-beginning 0))
+                              (line-number-at-pos (point))))
+                      (save-excursion
+                        (goto-char (match-beginning 0))
+                        (ignore-errors
+                          (progn
+                            (funcall hs-forward-sexp-func 1)
+                            (> (line-number-at-pos (point)) begin-line)))))
+                  t)
+            (let* ((ovl (make-overlay (match-beginning 0) (match-end 0)))
+                   (marker-string "*hideshowvis*"))
               (put-text-property 0
                                  (length marker-string)
                                  'display



reply via email to

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