send preview when markdown mode buffer is active
This commit is contained in:
parent
79d1f32769
commit
8c086640b8
@ -97,7 +97,8 @@
|
|||||||
(setq mdpm:local-client nil))))))
|
(setq mdpm:local-client nil))))))
|
||||||
|
|
||||||
(defun mdpm:send-preview ()
|
(defun mdpm:send-preview ()
|
||||||
(mdpm:send-preview-to mdpm:local-client))
|
(when (bound-and-true-p markdown-preview-mode)
|
||||||
|
(mdpm:send-preview-to mdpm:local-client)))
|
||||||
|
|
||||||
(defun mdpm:send-preview-to (websocket)
|
(defun mdpm:send-preview-to (websocket)
|
||||||
(let ((mark-position-percent
|
(let ((mark-position-percent
|
||||||
@ -105,7 +106,7 @@
|
|||||||
(truncate
|
(truncate
|
||||||
(* 100
|
(* 100
|
||||||
(/
|
(/
|
||||||
(float (- (line-number-at-pos) (count-screen-lines (window-start) (point))))
|
(float (- (line-number-at-pos) (/ (count-screen-lines (window-start) (point)) 2)))
|
||||||
(count-lines (point-min) (point-max))))))))
|
(count-lines (point-min) (point-max))))))))
|
||||||
(when markdown-preview-mode
|
(when markdown-preview-mode
|
||||||
(markdown markdown-output-buffer-name))
|
(markdown markdown-output-buffer-name))
|
||||||
|
Loading…
Reference in New Issue
Block a user