summaryrefslogtreecommitdiff
path: root/lisp/outline.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/outline.el')
-rw-r--r--lisp/outline.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/outline.el b/lisp/outline.el
index 013b0ae9505..a1ed3d44f7f 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -710,7 +710,10 @@ If nil, `show-entry' is called to reveal the invisible text.")
If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
(remove-overlays from to 'invisible 'outline)
(when flag
- (let ((o (make-overlay from to)))
+ ;; We use `front-advance' here because the invisible text begins at the
+ ;; very end of the heading, before the newline, so text inserted at FROM
+ ;; belongs to the heading rather than to the entry.
+ (let ((o (make-overlay from to nil 'front-advance)))
(overlay-put o 'invisible 'outline)
(overlay-put o 'isearch-open-invisible
(or outline-isearch-open-invisible-function