emacs-diffs
[Top][All Lists]
Advanced

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

master 40dafa9af0a 2/3: * lisp/org/org-src.el (org-src-font-lock-fontify


From: Stefan Monnier
Subject: master 40dafa9af0a 2/3: * lisp/org/org-src.el (org-src-font-lock-fontify-block): Fix point-min /= 1
Date: Wed, 20 Dec 2023 17:51:38 -0500 (EST)

branch: master
commit 40dafa9af0ae3b1826409ebed80cb65f56591ffb
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/org/org-src.el (org-src-font-lock-fontify-block): Fix point-min /= 1
---
 lisp/org/org-src.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index aadd8eba579..941399e15a5 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -658,7 +658,9 @@ as `org-src-fontify-natively' is non-nil."
                     (when new-prop
                       (if (not (eq prop 'invisible))
                          (put-text-property
-                          (+ start (1- pos)) (1- (+ start next)) prop new-prop
+                          (+ start (- pos (point-min)))
+                          (+ start (- next (point-min)))
+                          prop new-prop
                           org-buffer)
                         ;; Special case.  `invisible' text property may
                         ;; clash with Org folding.  Do not assign
@@ -690,7 +692,8 @@ as `org-src-fontify-natively' is non-nil."
                             (when invisibility-spec
                               (add-to-invisibility-spec invisibility-spec))
                             (put-text-property
-                            (+ start (1- pos)) (1- (+ start next))
+                            (+ start (- pos (point-min)))
+                            (+ start (- next (point-min)))
                              'org-src-invisible new-prop
                             org-buffer)))))))
                (setq pos next)))



reply via email to

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