feat: add support for CRLF EOL mode

This commit is contained in:
CJ van den Berg 2024-09-25 20:06:06 +02:00
parent 9a633aa2a9
commit 593b202b16
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
8 changed files with 119 additions and 50 deletions

View file

@ -306,7 +306,8 @@ fn diff_update(self: *Self) !void {
const editor = self.editor;
const new = editor.get_current_root() orelse return;
const old = if (editor.buffer) |buffer| buffer.last_save orelse return else return;
return self.diff.diff(diff_result, new, old);
const eol_mode = if (editor.buffer) |buffer| buffer.file_eol_mode else return;
return self.diff.diff(diff_result, new, old, eol_mode);
}
fn diff_result(from: tp.pid_ref, edits: []diff.Edit) void {