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
This commit is contained in:
wailo 2019-05-03 15:50:55 +00:00 committed by Carlo Sciolla
parent 2b84a2df52
commit 56f5cf7276
1 changed files with 4 additions and 3 deletions

View File

@ -285,10 +285,11 @@ to choose where to display it:
(switch-to-buffer-other-frame plantuml-preview-buffer))
((= prefix 4)
(switch-to-buffer-other-window plantuml-preview-buffer))
(t (switch-to-buffer plantuml-preview-buffer)))
(t (display-buffer plantuml-preview-buffer)))
(when imagep
(image-mode)
(set-buffer-multibyte t)))))))
(with-current-buffer plantuml-preview-buffer
(image-mode)
(set-buffer-multibyte t))))))))
(defun plantuml-preview-buffer (prefix)
"Preview diagram from the PlantUML sources in the current buffer.