Commit baaec43f authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(outline-next-heading): Make sure the match-data is correct where returning.

parent 869331ee
......@@ -326,9 +326,11 @@ at the end of the buffer."
(defun outline-next-heading ()
"Move to the next (possibly invisible) heading line."
(if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)")
;; Make sure we don't match the heading we're at.
(if (and (bolp) (not (eobp))) (forward-char 1))
(if (re-search-forward (concat "^\\(?:" outline-regexp "\\)")
nil 'move)
(goto-char (1+ (match-beginning 0)))))
(goto-char (match-beginning 0))))
(defun outline-previous-heading ()
"Move to the previous (possibly invisible) heading line."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment