forked from mirrors/org-mode
org-latex-preview: Optimize overlay-modify hook
* lisp/org-latex-preview.el (org-latex-preview-auto--mark-overlay-modified): Reduce slightly the number of checks needed to run each time text inside a LaTeX fragment overlay is modified.
This commit is contained in:
parent
3ab374790d
commit
7bd5973233
|
@ -378,8 +378,10 @@ overlay face is set to `org-latex-preview-processing-face'."
|
|||
(defun org-latex-preview-auto--mark-overlay-modified (ov after-p _beg _end &optional _l)
|
||||
"When AFTER-P mark OV as modified and display nothing."
|
||||
(when after-p
|
||||
(overlay-put ov 'preview-state 'modified)
|
||||
(overlay-put ov 'display nil)))
|
||||
(unless (eq (overlay-get ov 'preview-state) 'modified)
|
||||
(overlay-put ov 'preview-state 'modified)
|
||||
(overlay-put ov 'face nil)
|
||||
(overlay-put ov 'display nil))))
|
||||
|
||||
(defun org-latex-preview--update-overlay (ov path-info)
|
||||
"Update the overlay OV to show the image specified by PATH-INFO."
|
||||
|
|
Loading…
Reference in New Issue