Skip to content

Commit

Permalink
fix async test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny McClanahan committed Jan 10, 2016
1 parent 17b4718 commit cf3b6a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -5508,7 +5508,9 @@ the rendered output."
(when (buffer-live-p markdown-live-preview-view-buffer)
;; calls `kill-buffer-hook' within `markdown-live-preview-view-buffer'
(kill-buffer markdown-live-preview-view-buffer))
(when (process-live-p markdown-live-preview-currently-exporting-process)
(when (and markdown-live-preview-currently-exporting-process
(process-live-p markdown-live-preview-currently-exporting-process))
(set-process-sentinel markdown-live-preview-currently-exporting-process nil)
(delete-process markdown-live-preview-currently-exporting-process))
(setq markdown-live-preview-view-buffer nil
markdown-live-preview-currently-exporting-process nil)
Expand Down Expand Up @@ -6129,7 +6131,8 @@ before regenerating font-lock rules for extensions."
:group 'markdown-mode
:lighter " MD-Preview"
(if markdown-live-preview-mode
(markdown-live-preview-setup)
(condition-case nil (markdown-live-preview-setup)
(error (markdown-live-preview-mode -1)))
(markdown-live-preview-teardown-source)))


Expand Down
4 changes: 2 additions & 2 deletions tests/markdown-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -3306,8 +3306,6 @@ indented the same amount."

(defun markdown-test/live-preview-exports ()
(markdown-test-temp-file "inline.text"
(unless (require 'eww nil t)
(should-error (markdown-live-preview-mode)))
(let ((markdown-live-preview-idle-delay .01))
(markdown-temp-eww
(markdown-live-preview-mode)
Expand All @@ -3326,6 +3324,8 @@ indented the same amount."

(ert-deftest test-markdown-ext/live-preview-exports-sync ()
(let ((markdown-live-preview-do-sync t))
(unless (require 'eww nil t)
(should-error (markdown-live-preview-sync-export)))
(markdown-test/live-preview-exports)))

(ert-deftest test-markdown-ext/live-preview-exports-async ()
Expand Down

0 comments on commit cf3b6a7

Please sign in to comment.