-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop stealing focus to the preview buffer #66
Comments
I have the same issue, I even tried writing a little elisp function to switch back to the previous window, with no luck. I might've messed up the function, here it is for inspection. (add-hook 'plantuml-mode-hook
(lambda ()
(add-hook 'before-save-hook
(lambda ()
(plantuml-preview 4)
(evil-window-prev))
nil 'local))) It hooks onto the save of the plantuml-mode, and tries to switch to the other window after preview has been initiated. It ends up switching to the previous buffer before the new preview window has appeared, rendering the snippet useless. |
PR #93 addresses this issue. I will appreciate if you can try it and provide feedback |
Yep, I will have a look at #93 shortly, stay tuned for updates |
This is yet another attempt at fixing #66, using a different approach than #93 By using `display-buffer` the preview buffer should stay wherever the user put it last without jumping around and without stealing focus from the source buffer. As an additional bonus, a temporary buffer is used to enable some sort of double buffering and avoid the flicker of seeing the preview buffer disappear
Closing as #93 is merged / released |
Summary
I'm trying to keep an mostly/always visible preview next to the file I'm editing, somewhat along the lines of #65 I imagine -- I can do this with
(plantuml-preview 4)
and it more or less works...except that that buffer always steals the keyboard focus so that I can't just continue editing but rather always need to manually switch back to the editing. I've tried wrapping my call in
(save-current-buffer)
and others but it seems plantuml is switching to the buffer only after a random delay making it ineffective in practice.Please allow updating a preview without switching to that buffer.
The text was updated successfully, but these errors were encountered: