瀏覽代碼

org-element--cache-find: Do not hash section/org-data/table elements

* lisp/org-element.el (org-element--cache-find): Never use hashed
elements with children that can have the same :begin property.
Ihor Radchenko 2 年之前
父節點
當前提交
96746438c0
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      lisp/org-element.el

+ 4 - 0
lisp/org-element.el

@@ -5764,6 +5764,10 @@ the cache."
                    ;; Limit can be a list key.
                    (org-element--cache-key-less-p pos limit))
                (= pos (org-element-property :begin hashed))
+               ;; We cannot rely on element :begin for elements with
+               ;; children starting at the same pos.
+               (not (memq (org-element-type hashed)
+                        '(section org-data table)))
                (org-element-property :cached hashed))
           (progn
             (cl-incf (car org-element--cache-hash-statistics))