mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-16 02:06:23 -04:00
Fix off-by-one jump to Org heading line
This wouid match the wrong heading if there were no spaces between the headings. Thanks to kilesduli for bringing this matter to my attention in issue 354: <https://github.com/protesilaos/denote/issues/354>.
This commit is contained in:
parent
7fe739fed0
commit
be17fcb027
|
|
@ -72,9 +72,10 @@ the current file."
|
|||
"Return heading text and CUSTOM_ID from the given LINE in FILE."
|
||||
(with-current-buffer (find-file-noselect file)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(forward-line line)
|
||||
(cons (denote-link-ol-get-heading) (denote-link-ol-get-id)))))
|
||||
(save-restriction
|
||||
(goto-char (point-min))
|
||||
(forward-line (1- line))
|
||||
(cons (denote-link-ol-get-heading) (denote-link-ol-get-id))))))
|
||||
|
||||
(defun denote-org-extras-format-link-with-heading (file heading-id description)
|
||||
"Prepare link to FILE with HEADING-ID using DESCRIPTION."
|
||||
|
|
|
|||
Loading…
Reference in a new issue