org-forward-heading-same-level: Do not rely on match-data from `org-back-to-heading'
* lisp/org.el (org-forward-heading-same-level): Use `org-current-level' instead of relying upon `org-back-to-heading' to set match data. Reported-by: Nick Dokos <ndokos@gmail.com> Link: https://orgmode.org/list/87352hk0nt.fsf@alphaville.usersys.redhat.com
This commit is contained in:
parent
57bb9cada3
commit
0a842cc94b
|
@ -20659,7 +20659,7 @@ non-nil it will also look at invisible ones."
|
|||
(if backward? (goto-char (point-min)) (outline-next-heading))
|
||||
(org-back-to-heading invisible-ok)
|
||||
(unless backward? (end-of-line)) ;do not match current headline
|
||||
(let ((level (- (match-end 0) (match-beginning 0) 1))
|
||||
(let ((level (org-current-level))
|
||||
(f (if backward? #'re-search-backward #'re-search-forward))
|
||||
(count (if arg (abs arg) 1))
|
||||
(result (point)))
|
||||
|
|
Loading…
Reference in New Issue