Commit b19a0bf
committed
Delegate diff rendering wholesale to termflow 0.3.0
Diff parsing, syntax highlighting, backgrounds, and theme tints now live
in termflow.diff; tools/common.py keeps only thin adapters. Deleted the
pygments machinery (TOKEN_COLORS, EXTENSION_TO_LEXER_NAME,
_get_lexer_for_extension, _get_token_color, _highlight_code_line,
_extract_file_extension_from_diff, _format_diff_with_syntax_highlighting,
PYGMENTS_AVAILABLE) — ~350 lines gone, and language detection upgraded
for free via termflow's LANGUAGE_ALIASES.
Adapters: _termflow_diff_renderer wires the termflow_highlighter theme
callback (diff_line_tints contract preserved) plus the user's configured
/diff colors; format_diff_with_colors keeps its signature (block mode,
Text.from_ansi) so diff-menu previews are untouched; new
stream_diff_ansi_lines yields rendered ANSI lines incrementally via
termflow's DiffStream, and rich_renderer._render_diff now prints diffs
progressively line-by-line instead of one monolithic Text block.1 parent 4e2ce27 commit b19a0bf
6 files changed
Lines changed: 117 additions & 521 deletions
File tree
- code_puppy
- messaging
- tools
- tests
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
873 | | - | |
| 873 | + | |
874 | 874 | | |
875 | 875 | | |
876 | 876 | | |
| |||
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
890 | | - | |
891 | | - | |
892 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
893 | 897 | | |
894 | 898 | | |
895 | 899 | | |
| |||
0 commit comments