more precise scrolling

pull/3/head
Igor Shymko 8 years ago
parent d42dddd328
commit b6cef9d156
  1. 1
      README.md
  2. 3
      markdown-preview-mode.el

@ -4,6 +4,7 @@ Markdown preview mode
## Description
Opens a preview in a browser, updated upon buffer save.
Same preview window is valid across multiple markdown buffers.
Scrolls browser window to keep your editing position visible.
## Dependencies

@ -100,9 +100,8 @@
(truncate
(* 100
(/
(float (line-number-at-pos))
(float (- (line-number-at-pos) (count-screen-lines (window-start) (point))))
(count-lines (point-min) (point-max))))))))
(when markdown-preview-mode
(markdown markdown-output-buffer-name))
(with-current-buffer (get-buffer markdown-output-buffer-name)

Loading…
Cancel
Save