Function: ediff-get-lines-to-region-start

ediff-get-lines-to-region-start is a byte-compiled function defined in ediff-util.el.gz.

Signature

(ediff-get-lines-to-region-start BUF-TYPE &optional DIFF-NUM CTL-BUF)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/ediff-util.el.gz
;; Calculate the number of lines from window end to the start of diff region
(defun ediff-get-lines-to-region-start (buf-type &optional diff-num ctl-buf)
  (or diff-num (setq diff-num ediff-current-difference))
  (or ctl-buf (setq ctl-buf ediff-control-buffer))
  (ediff-with-current-buffer ctl-buf
    (let* ((buf (ediff-get-buffer buf-type))
	   (wind (symbol-value (ediff-get-symbol-from-alist
                                buf-type ediff-window-alist)))
	   (end (or (window-end wind) (window-end wind t)))
	   (beg (ediff-get-diff-posn buf-type 'beg diff-num)))
      (ediff-with-current-buffer buf
	(if (< beg end)
	    (count-lines (max beg (point-min)) (min end (point-max))) 0))
      )))