feat(diff): third, regular diff mode

This commit is contained in:
Barrett Ruth 2025-09-21 17:18:22 -04:00
parent 7d51fc2931
commit ff20efca71
6 changed files with 126 additions and 12 deletions

View file

@ -22,6 +22,20 @@ local vim_backend = {
end,
}
---@type DiffBackend
local none_backend = {
name = 'none',
render = function(expected, actual)
local expected_lines = vim.split(expected, '\n', { plain = true, trimempty = true })
local actual_lines = vim.split(actual, '\n', { plain = true, trimempty = true })
return {
content = { expected = expected_lines, actual = actual_lines },
highlights = {},
}
end,
}
---@type DiffBackend
local git_backend = {
name = 'git',
@ -143,6 +157,7 @@ local git_backend = {
---@type table<string, DiffBackend>
local backends = {
none = none_backend,
vim = vim_backend,
git = git_backend,
}