Skip to content

Commit 56f5cf7

Browse files
wailoskuro
authored andcommitted
Improving preview functionality. No buffer switch. (#93)
* Improving preview functionality. No buffer switch. - Using temp buffer instead of new buffer. - Windows layout is retained. No need to switch buffer after every preview
1 parent 2b84a2d commit 56f5cf7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plantuml-mode.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,11 @@ to choose where to display it:
285285
(switch-to-buffer-other-frame plantuml-preview-buffer))
286286
((= prefix 4)
287287
(switch-to-buffer-other-window plantuml-preview-buffer))
288-
(t (switch-to-buffer plantuml-preview-buffer)))
288+
(t (display-buffer plantuml-preview-buffer)))
289289
(when imagep
290-
(image-mode)
291-
(set-buffer-multibyte t)))))))
290+
(with-current-buffer plantuml-preview-buffer
291+
(image-mode)
292+
(set-buffer-multibyte t))))))))
292293

293294
(defun plantuml-preview-buffer (prefix)
294295
"Preview diagram from the PlantUML sources in the current buffer.

0 commit comments

Comments
 (0)