| Name | Type | Description |
|---|---|---|
diff* | str | Unified diff string. |
max_lines | int | None | Default: 100Maximum number of rendered rows to show (None for
unlimited). Rows are not diff lines: file and hunk headers are
dropped and hunk separators added, so this does not correspond to a
line count in |
path | str | Default: ''Path of the diffed file, used to pick a syntax highlighter. |
before | str | Default: '' |
after | str | Default: '' |
show_numbers | bool | Default: True |
Yield syntax-highlighted widgets for a unified diff.
Source aligned to the diff's old line numbers. May be a truncated prefix or empty; rows whose text does not match the lexed source are left unhighlighted (logged once per side at warning).
Source aligned to the diff's new line numbers, same contract.
Context rows are read from here, not from before — see
_Row.number.
Whether to render the line-number gutter. Pass False
when the diff's line numbers are not the file's — e.g. a diff of
edit fragments, whose hunks always start at 1.