Fix sending server frame to all the clients
This commit is contained in:
parent
97d9276210
commit
b9d815f6b9
@ -5,7 +5,7 @@
|
|||||||
;; Author: Igor Shymko <igor.shimko@gmail.com>
|
;; Author: Igor Shymko <igor.shimko@gmail.com>
|
||||||
;; URL: https://github.com/ancane/markdown-preview-mode
|
;; URL: https://github.com/ancane/markdown-preview-mode
|
||||||
;; Keywords: markdown, preview
|
;; Keywords: markdown, preview
|
||||||
;; Version: 0.2
|
;; Version: 0.3
|
||||||
;; Package-Requires: ((websocket "1.5") (markdown-mode "2.1") (cl-lib "0.5"))
|
;; Package-Requires: ((websocket "1.5") (markdown-mode "2.1") (cl-lib "0.5"))
|
||||||
|
|
||||||
;; This file is not part of GNU Emacs.
|
;; This file is not part of GNU Emacs.
|
||||||
@ -97,9 +97,7 @@
|
|||||||
(websocket-server
|
(websocket-server
|
||||||
markdown-preview-port
|
markdown-preview-port
|
||||||
:on-message (lambda (websocket frame)
|
:on-message (lambda (websocket frame)
|
||||||
(mapc (lambda (ws)
|
(mapc (lambda (ws) (websocket-send ws frame))
|
||||||
(websocket-send-text ws
|
|
||||||
(websocket-frame-payload frame)))
|
|
||||||
markdown-preview--remote-clients))
|
markdown-preview--remote-clients))
|
||||||
:on-open (lambda (websocket)
|
:on-open (lambda (websocket)
|
||||||
(push websocket markdown-preview--remote-clients)
|
(push websocket markdown-preview--remote-clients)
|
||||||
@ -156,7 +154,7 @@
|
|||||||
(markdown-preview--start-websocket-server)
|
(markdown-preview--start-websocket-server)
|
||||||
(markdown-preview--start-local-client)
|
(markdown-preview--start-local-client)
|
||||||
(setq markdown-preview--idle-timer
|
(setq markdown-preview--idle-timer
|
||||||
(run-with-idle-timer 2 t 'markdown-preview--send-preview))
|
(run-with-idle-timer 2 t (lambda () (markdown-preview--send-preview))))
|
||||||
(add-hook 'after-save-hook 'markdown-preview--send-preview nil t)
|
(add-hook 'after-save-hook 'markdown-preview--send-preview nil t)
|
||||||
(add-hook 'kill-buffer-hook 'markdown-preview--stop))
|
(add-hook 'kill-buffer-hook 'markdown-preview--stop))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user