Skip to content

Commit 881898a

Browse files
author
Danny McClanahan
committed
fix bugs with sync/async
1 parent 959d494 commit 881898a

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

markdown-mode.el

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5450,20 +5450,23 @@ the rendered output."
54505450
;; get positions in all windows currently displaying output buffer
54515451
(window-data
54525452
(markdown-live-preview-window-serialize
5453-
markdown-live-preview-view-buffer)))
5454-
(save-window-excursion
5455-
(let ((view-buf
5456-
(funcall markdown-live-preview-window-function export-file)))
5457-
(markdown-live-preview-link-source-view-buffers src-buf view-buf)
5458-
(with-current-buffer view-buf
5459-
(add-hook 'kill-buffer-hook
5460-
#'markdown-live-preview-teardown-view t t))))
5453+
markdown-live-preview-view-buffer))
5454+
(view-buf
5455+
(save-window-excursion
5456+
(funcall markdown-live-preview-window-function export-file))))
5457+
(markdown-live-preview-link-source-view-buffers src-buf view-buf)
5458+
(with-current-buffer view-buf
5459+
(add-hook 'kill-buffer-hook
5460+
#'markdown-live-preview-teardown-view t t))
54615461
(with-current-buffer src-buf
54625462
;; reset all windows displaying output buffer to where they were,
54635463
;; now with the new output
5464-
(mapc #'markdown-live-preview-window-deserialize window-data)
5464+
(mapc (lambda (data)
5465+
(markdown-live-preview-window-deserialize data view-buf))
5466+
window-data)
54655467
;; delete html editing buffer
5466-
(let ((buf (get-file-buffer export-file))) (when buf (kill-buffer buf)))
5468+
(let ((buf (get-file-buffer export-file)))
5469+
(when buf (kill-buffer buf)))
54675470
(when (and export-file (file-exists-p export-file)
54685471
(eq markdown-live-preview-delete-export
54695472
'delete-on-export))
@@ -5481,7 +5484,8 @@ the rendered output."
54815484
(progn
54825485
(add-hook
54835486
'after-save-hook #'markdown-live-preview-do-sync-preview t t)
5484-
(markdown-live-preview-sync-export))
5487+
(markdown-display-buffer-other-window
5488+
(markdown-live-preview-sync-export)))
54855489
(setq markdown-live-preview-idle-timer
54865490
(run-with-idle-timer
54875491
markdown-live-preview-idle-delay t

0 commit comments

Comments
 (0)