Fix bug in org-get-heading

Fixes #26, where fontification could make the matching and extraction of heading
components fail.
This commit is contained in:
Anders Johansson 2021-04-30 14:09:05 +02:00 committed by Ihor Radchenko
parent 240a14988f
commit baffebbc33
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 3 additions and 2 deletions

View File

@ -6167,8 +6167,9 @@ Return nil before first heading."
(let ((case-fold-search nil))
(looking-at org-complex-heading-regexp)
;; When using `org-fold-core--optimise-for-huge-buffers',
;; returned text may be invisible. Clear it up.
(org-fold-core-remove-optimisation (match-beginning 0) (match-end 0))
;; returned text will be invisible. Clear it up.
(save-match-data
(org-fold-core-remove-optimisation (match-beginning 0) (match-end 0)))
(let ((todo (and (not no-todo) (match-string 2)))
(priority (and (not no-priority) (match-string 3)))
(headline (pcase (match-string 4)