summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/hunks.zig5
-rw-r--r--core/lib_syntax.zig3
2 files changed, 6 insertions, 2 deletions
diff --git a/core/hunks.zig b/core/hunks.zig
index 98584980..bee06cc2 100644
--- a/core/hunks.zig
+++ b/core/hunks.zig
@@ -80,7 +80,10 @@ pub const Ctx = struct {
pub const Source = struct { path: []const u8, bytes: []const u8 };
/// A diff stacked: its text, and a row for each of its lines (row i is
-/// line i), the arena's; a row's path may be the diff's own bytes.
+/// line i), the arena's; a row's path may be the diff's own bytes. A row's
+/// text is its line without its end, the `\n` and a `\r` before it: a CRLF
+/// diff's rows have no `\r` (one that must show it reads it off the diff),
+/// and a source's lines are compared with the diff's so too.
pub const Patch = struct { text: []const u8, rows: []const Row };
pub const Row = struct {
diff --git a/core/lib_syntax.zig b/core/lib_syntax.zig
index 0bb3f510..759720ec 100644
--- a/core/lib_syntax.zig
+++ b/core/lib_syntax.zig
@@ -72,7 +72,8 @@ pub const ground_line = syntax.ground_line;
pub const Grounds = colors.Grounds;
/// A unified diff stacked as pardes's patch view (its +Diff) shows it:
-/// `formatPatch` gives a `Patch`, its text and a `PatchRow` a line: a
+/// `formatPatch` gives a `Patch`, its text (each line without its end: no
+/// `\r` from a CRLF diff) and a `PatchRow` a line: a
/// hunk's `path:line`, the declarations it stands in (or git's function
/// line), its lines with both their numbers, each byte's style (a `Syn`
/// when `colors` are given, the grounds, the words a changed line changed).