This commit is contained in:
Bram Schoenmakers 2022-10-14 16:28:37 +02:00 committed by GitHub
commit 12a3868903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -404,7 +404,8 @@ Window is selected according to PREFIX:
(when imagep (when imagep
(with-current-buffer buf (with-current-buffer buf
(image-mode) (image-mode)
(set-buffer-multibyte t))))) (set-buffer-multibyte t)))
(set-window-point (get-buffer-window buf 'visible) (point-min))))
(defun plantuml-jar-preview-string (prefix string buf) (defun plantuml-jar-preview-string (prefix string buf)
"Preview the diagram from STRING by running the PlantUML JAR. "Preview the diagram from STRING by running the PlantUML JAR.
@ -482,9 +483,10 @@ Put the result into buffer BUF, selecting the window according to PREFIX:
(defun plantuml-preview-string (prefix string) (defun plantuml-preview-string (prefix string)
"Preview diagram from PlantUML sources (as STRING), using prefix (as PREFIX) "Preview diagram from PlantUML sources (as STRING), using prefix (as PREFIX)
to choose where to display it." to choose where to display it."
(let ((b (get-buffer plantuml-preview-buffer))) (when-let ((b (get-buffer plantuml-preview-buffer))
(when b (inhibit-read-only t))
(kill-buffer b))) (with-current-buffer b
(erase-buffer)))
(let* ((imagep (and (display-images-p) (let* ((imagep (and (display-images-p)
(plantuml-is-image-output-p))) (plantuml-is-image-output-p)))