forked from mirrors/org-mode
Merge branch 'bugfix'
This commit is contained in:
commit
e4504853b5
|
@ -6812,19 +6812,7 @@ The function returns the new value of `org-element--cache-change-warning'."
|
|||
(setq org-element--cache-last-buffer-size (buffer-size))
|
||||
(goto-char beg)
|
||||
(forward-line 0)
|
||||
(let ((bottom (save-excursion
|
||||
(goto-char end)
|
||||
(if (and (bolp)
|
||||
;; When beg == end, still extent to eol.
|
||||
(> (point) beg))
|
||||
;; FIXME: Potential pitfall.
|
||||
;; We are appending to an element end.
|
||||
;; Unless the last inserted char is not
|
||||
;; newline, the next element is not broken
|
||||
;; and does not need to be purged from the
|
||||
;; cache.
|
||||
end
|
||||
(line-end-position)))))
|
||||
(let ((bottom (save-excursion (goto-char end) (line-end-position))))
|
||||
(prog1
|
||||
;; Use the worst change warning to not miss important edits.
|
||||
;; This function is called before edit and after edit by
|
||||
|
|
|
@ -5194,7 +5194,32 @@ paragraph
|
|||
(let ((org-element-use-cache t))
|
||||
(org-element-at-point (point-max))
|
||||
(delete-region (point) (point-max))
|
||||
(should (eq 'paragraph (org-element-type (org-element-at-point)))))))
|
||||
(should (eq 'paragraph (org-element-type (org-element-at-point))))))
|
||||
;; Remove/re-introduce heading.
|
||||
(org-test-with-temp-text
|
||||
"
|
||||
* 1
|
||||
** 1-1
|
||||
a
|
||||
<point>** 1-2
|
||||
a
|
||||
"
|
||||
(let ((org-element-use-cache t))
|
||||
(org-element-at-point (point-max))
|
||||
(insert "FOO")
|
||||
(should
|
||||
(equal
|
||||
"1-1"
|
||||
(org-element-property
|
||||
:title
|
||||
(org-element-lineage (org-element-at-point) '(headline)))))
|
||||
(insert "\n")
|
||||
(should
|
||||
(equal
|
||||
"1"
|
||||
(org-element-property
|
||||
:title
|
||||
(org-element-lineage (org-element-at-point) '(headline))))))))
|
||||
|
||||
(provide 'test-org-element)
|
||||
|
||||
|
|
Loading…
Reference in New Issue