Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate produces a unified diff string between oldContent and newContent. It uses a simple LCS-based diff algorithm with 3 lines of context.
func GenerateForDelete ¶
GenerateForDelete generates a diff showing the entire file as removed.
func GenerateForNewFile ¶
GenerateForNewFile generates a diff showing the entire file as added.
func Render ¶
Render takes a unified diff string and returns it with ANSI color codes. - "---" and "+++" header lines: bold - "@@" hunk headers: cyan - "-" removed lines: red - "+" added lines: green - context lines: default (no color)
func RenderCompact ¶
RenderCompact is like Render but truncates output to maxLines lines. If the diff exceeds maxLines, a "... (N more lines)" message is appended.
Types ¶
This section is empty.