Skip to content

Commit 4c77493

Browse files
author
Danny McClanahan
committed
fix bugs with sync/async
1 parent b50a8c3 commit 4c77493

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
@@ -6030,20 +6030,23 @@ the rendered output."
60306030
;; get positions in all windows currently displaying output buffer
60316031
(window-data
60326032
(markdown-live-preview-window-serialize
6033-
markdown-live-preview-view-buffer)))
6034-
(save-window-excursion
6035-
(let ((view-buf
6036-
(funcall markdown-live-preview-window-function export-file)))
6037-
(markdown-live-preview-link-source-view-buffers src-buf view-buf)
6038-
(with-current-buffer view-buf
6039-
(add-hook 'kill-buffer-hook
6040-
#'markdown-live-preview-teardown-view t t))))
6033+
markdown-live-preview-view-buffer))
6034+
(view-buf
6035+
(save-window-excursion
6036+
(funcall markdown-live-preview-window-function export-file))))
6037+
(markdown-live-preview-link-source-view-buffers src-buf view-buf)
6038+
(with-current-buffer view-buf
6039+
(add-hook 'kill-buffer-hook
6040+
#'markdown-live-preview-teardown-view t t))
60416041
(with-current-buffer src-buf
60426042
;; reset all windows displaying output buffer to where they were,
60436043
;; now with the new output
6044-
(mapc #'markdown-live-preview-window-deserialize window-data)
6044+
(mapc (lambda (data)
6045+
(markdown-live-preview-window-deserialize data view-buf))
6046+
window-data)
60456047
;; delete html editing buffer
6046-
(let ((buf (get-file-buffer export-file))) (when buf (kill-buffer buf)))
6048+
(let ((buf (get-file-buffer export-file)))
6049+
(when buf (kill-buffer buf)))
60476050
(when (and export-file (file-exists-p export-file)
60486051
(eq markdown-live-preview-delete-export
60496052
'delete-on-export))
@@ -6062,7 +6065,8 @@ the rendered output."
60626065
(progn
60636066
(add-hook
60646067
'after-save-hook #'markdown-live-preview-do-sync-preview t t)
6065-
(markdown-live-preview-sync-export))
6068+
(markdown-display-buffer-other-window
6069+
(markdown-live-preview-sync-export)))
60666070
(setq markdown-live-preview-idle-timer
60676071
(run-with-idle-timer
60686072
markdown-live-preview-idle-delay t

0 commit comments

Comments
 (0)