Skip to main content

Crate sley_diff_format

Crate sley_diff_format 

Source

Structs§

CompiledFuncname
A compiled funcname spec: newline-separated POSIX regexes tried in order; a leading ! negates (a match rejects the line). Port of xdiff_set_find_func + ff_regexp from upstream xdiff-interface.c.
DiffColors
ANSI palette for colored diff output. Each slot holds the escape sequence (empty when color is disabled), mirroring diff_get_color.
WordDiffAdapter
Bridge a word-diff config + its line buffers into the engine’s HunkWordDiff hook. The engine owns hunk shaping; this adapter owns the word-level rendering.
WordDiffBuffers
The per-hunk word-diff renderer state: accumulated minus/plus text.
WordDiffConfig
Word-diff configuration for one file pair: the rendering mode, the compiled word regex (None = whitespace tokenization), and the palette.

Enums§

WordDiffMode

Functions§

default_funcname_heading
Port of def_ff (the default funcname heuristic): a line whose first byte is a letter, _, or $ is a section heading, truncated to the 80-byte header buffer with trailing whitespace trimmed.
heading_classifier
A per-line section-heading classifier matching git’s funcname resolution: a userdiff xfuncname pattern when a driver is present, else the default def_ff heuristic.
parse_color_value
Parse a git color word (“red”, “bold”, “green dim”, …) into an ANSI sequence. Only the simple forms the diff palette uses are supported; unknown words yield None (caller keeps the default).
push_colored_line
Wrap one already-newline-terminated line in a color, mirroring emit_line_0: the reset lands before the trailing newline, and a line that is empty (ignoring its newline) is passed through uncolored.
render_colors
Map a diff color palette into the engine’s render-color borrow.