Add custom time variable.

This commit is contained in:
jenchieh 2020-08-30 15:01:46 +08:00
parent f98d9114ca
commit 77fe9d4b69
1 changed files with 20 additions and 14 deletions

View File

@ -79,6 +79,11 @@
(const :tag "Via http" http)
(const :tag "Off" nil)))
(defcustom markdown-preview-delay-time 2.0
"Refresh preview after this certain of time."
:group 'markdown-preview
:type 'float)
(defvar markdown-preview-javascript '()
"List of client javascript libs for preview.")
@ -327,7 +332,8 @@
(markdown-preview--start-local-client)
(markdown-preview--start-http-server markdown-preview-http-port)
(setq markdown-preview--idle-timer
(run-with-idle-timer 2 t (lambda ()
(run-with-idle-timer markdown-preview-delay-time t
(lambda ()
(when markdown-preview--uuid
(markdown-preview--send-preview markdown-preview--uuid)))))
(add-hook 'after-save-hook (lambda ()