nomonic
    Preparing search index...

    Function extractAddedLines

    • Parse a unified diff and extract the added lines with their file line numbers.

      Tracks hunk headers (@@ ... @@) to maintain accurate line numbering. Removed lines (-) do not advance the line counter; context lines do.

      Parameters

      • diff: string

        A unified diff string (e.g. from git diff --cached).

      Returns AddedLine[]

      An array of AddedLine objects for each + line in the diff.