Przeglądaj źródła

Fix fontification of plain links at beginning of buffer

* lisp/org.el (org-activate-plain-links): Ensure that a valid buffer
  position is given as first argument to get-text-property, in
  particular when the plain link is at the very beginning of the buffer.

TINYCHANGE
Rafael Laboissiere 9 lat temu
rodzic
commit
860bcfbf93
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      lisp/org.el

+ 4 - 1
lisp/org.el

@@ -5852,7 +5852,10 @@ prompted for."
   (let (f hl)
     (when (and (re-search-forward (concat org-plain-link-re) limit t)
 	       (not (member 'org-tag
-			    (get-text-property (1- (match-beginning 0)) 'face)))
+			    (get-text-property (cond
+                                                ((= 1 (match-beginning 0)) 1)
+                                                (t (1- (match-beginning 0))))
+                                               'face)))
 	       (not (org-in-src-block-p)))
       (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
       (setq f (get-text-property (match-beginning 0) 'face))