1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

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
parent 4bcf3ea0e1
commit f02cf2704c
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)