Function: magit-diff--modified-lines

magit-diff--modified-lines is a byte-compiled function defined in magit-diff.el.

Signature

(magit-diff--modified-lines BOUND)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-diff.el
(defun magit-diff--modified-lines (bound)
  (let (-lines +lines)
    (while (re-search-forward
            "^@@ -\\([0-9]+\\),[^ ]+ \\+\\([0-9]+\\),[^ ]+ @@.*\n" bound t)
      (let ((-line (string-to-number (match-string 1)))
            (+line (string-to-number (match-string 2))))
        (while (and (not (eobp))
                    (memq (char-after) '(?\s ?- ?+)))
          (pcase (char-after)
            (?\s (cl-incf -line)
                 (cl-incf +line))
            (?-  (push (cl-incf -line) -lines))
            (?+  (push (cl-incf +line) +lines)))
          (forward-line))))
    (list (nreverse -lines)
          (nreverse +lines))))