org-latex-preview: Set overlay priority to -80

* lisp/org-latex-preview.el (org-latex-preview--ensure-overlay): Setting
the overlay priority to -80 ensures that the background colour of
hl-line-mode's overlays takes priority, improving the visual consistency
of previews in the buffer.
This commit is contained in:
TEC 2023-03-14 01:25:06 +08:00
parent 39e0faebd1
commit 4ec83eb21e
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 4 additions and 0 deletions

View File

@ -307,6 +307,9 @@ in `org-latex-preview--svg-make-fg-currentColor', and so it
should be a color that is extremely likely not otherwise found in
the image.")
(defconst org-latex-preview--overlay-priority -80
"The priority used with preview overlays.")
(defun org-latex-preview--ensure-overlay (beg end)
"Build an overlay between BEG and END."
(let (ov)
@ -334,6 +337,7 @@ the image.")
(setq ov (make-overlay beg end nil 'front-advance))
(overlay-put ov 'org-overlay-type 'org-latex-overlay)
(overlay-put ov 'evaporate t)
(overlay-put ov 'priority org-latex-preview--overlay-priority)
(overlay-put ov 'modification-hooks
(list #'org-latex-preview-auto--mark-overlay-modified))
(overlay-put ov 'insert-in-front-hooks