org-element: Fix cache corruption when moving list
* lisp/org-element.el (org-element--shift-positions): Fix cache corruption when moving list.
This commit is contained in:
parent
54a64f50b5
commit
91c1718519
|
@ -4819,12 +4819,12 @@ modified by side-effect. Return modified element."
|
|||
;; Shift :structure property for the first plain list only: it is
|
||||
;; the only one that really matters and it prevents from shifting
|
||||
;; it more than once.
|
||||
(when (eq (car element) 'plain-list)
|
||||
(let ((structure (plist-get properties :structure)))
|
||||
(when (<= (plist-get properties :begin) (caar structure))
|
||||
(dolist (item structure)
|
||||
(incf (car item) offset)
|
||||
(incf (nth 6 item) offset)))))
|
||||
(when (and (eq (org-element-type element) 'plain-list)
|
||||
(not (eq (org-element-type (plist-get properties :parent))
|
||||
'item)))
|
||||
(dolist (item (plist-get properties :structure))
|
||||
(incf (car item) offset)
|
||||
(incf (nth 6 item) offset)))
|
||||
(plist-put properties :begin (+ (plist-get properties :begin) offset))
|
||||
(plist-put properties :end (+ (plist-get properties :end) offset))
|
||||
(dolist (key '(:contents-begin :contents-end :post-affiliated))
|
||||
|
|
Loading…
Reference in New Issue