Commit 6a2a371c authored by Dmitry Gutov's avatar Dmitry Gutov

(repos-count-screen-lines): Narrow without changing point-min

* lisp/reposition.el (repos-count-screen-lines): Narrow without
changing point-min.  It wasn't necessary for vertical-motion to
work, and it had some adverse effects on how font-lock rules were
This can also be an alternative fix for bug#38049.
parent c455e609
Pipeline #4043 failed with stage
in 65 minutes and 12 seconds
......@@ -170,12 +170,13 @@ first comment line visible (if point is in a comment)."
;;; Auxiliary functions
;; Return number of screen lines between START and END.
(defun repos-count-screen-lines (start end)
(narrow-to-region start end)
(goto-char (point-min))
(narrow-to-region (point-min) end)
(goto-char start)
(vertical-motion (- (point-max) (point-min))))))
;; Return number of screen lines between START and END; returns a negative
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment