branch: main
commit 1a2520807173318a70f3de6074238751a583974f
Author: Paul Nelson <[email protected]>
Commit: Paul Nelson <[email protected]>
Fix live preview regression
* preview.el (preview-replace-active-icon): Correct the order of
operations when replacing a preview with
'preview-leave-open-previews-visible' enabled: first mutate the
spec, then flush. Commit 26807f1c added the flush in the other
order. This caused a regression where the preview would update
correctly on the first edit, but fail on subsequent edits.
---
preview.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/preview.el b/preview.el
index 3b3f63ac..88886b83 100644
--- a/preview.el
+++ b/preview.el
@@ -1220,12 +1220,12 @@ ready. This behavior suppresses flicker in the
appearance."
(defsubst preview-replace-active-icon (ov replacement)
"Replace the active Icon in OV by REPLACEMENT, another icon."
(let ((img (overlay-get ov 'preview-image)))
+ (setcdr (car img) (cdar replacement))
+ (setcdr img (cdr replacement))
(when (and preview-leave-open-previews-visible
(consp img))
;; No "TeX icon" has been shown, so we flush manually.
- (image-flush (car img) t))
- (setcdr (car img) (cdar replacement))
- (setcdr img (cdr replacement))))
+ (image-flush (car img) t))))
(defun preview-gs-place (ov snippet box run-buffer tempdir ps-file _imagetype)
"Generate an image placeholder rendered over by Ghostscript.