]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/org/org-src.el (org-src-font-lock-fontify-block): Fix point-min /= 1
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 20 Dec 2023 22:50:09 +0000 (17:50 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 20 Dec 2023 22:50:09 +0000 (17:50 -0500)
lisp/org/org-src.el

index aadd8eba5795ad53207358a7f67ff0bac8d80a5a..941399e15a52250da3786bf2d0a64610dc5138e9 100644 (file)
@@ -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)))