LibDiff: Add support for writing formatted context hunks

There is a little bit more complexity involved here than the other
formats. In particular, this is due to the need to determine whether
an addition line or removal line is just that, or a 'change'.
This commit is contained in:
Shannon Booth 2023-07-03 17:16:16 +12:00 committed by Andreas Kling
commit f02cf2704c
Notes: sideshowbarker 2024-07-16 23:52:10 +09:00
3 changed files with 119 additions and 0 deletions

View file

@ -31,6 +31,8 @@ struct Line {
Removal = '-',
Context = ' ',
// NOTE: This should only be used when deconstructing a hunk into old and new lines (context format)
Change = '!',
};
static constexpr Operation operation_from_symbol(char symbol)