Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lua/diffs-collection/generated/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ function M.apply(bufnr)
priority.syntax + 2
)
if opts.highlights.background then
mark(0, width, 'Diffs' .. kind, priority.line_bg)
vim.api.nvim_buf_set_extmark(bufnr, ns, row, 0, {
virt_text = { { '▏', 'Diffs' .. kind .. 'Bar' } },
virt_text_pos = 'overlay',
Expand Down
17 changes: 15 additions & 2 deletions spec/core_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,21 @@ assert(#marks > 0, 'The first split has no intra-line highlights')
end
end
assert.is_true(context)
local rails = vim.api.nvim_buf_get_extmarks(buf, ns.diffs_collection_rails, 0, -1, {})
assert.is_true(#rails > 0)
local backgrounds = {}
for _, mark in
ipairs(
vim.api.nvim_buf_get_extmarks(buf, ns.diffs_collection_rails, 0, -1, { details = true })
)
do
local detail = mark[4]
if detail.hl_group == 'DiffsAdd' or detail.hl_group == 'DiffsDelete' then
backgrounds[#backgrounds + 1] = { mark[2], mark[3], detail.end_col, detail.hl_group }
end
end
assert.are.same({
{ 2, 0, info.prefix_width, 'DiffsDelete' },
{ 3, 0, info.prefix_width, 'DiffsAdd' },
}, backgrounds)
vim.api.nvim_buf_delete(buf, { force = true })
end)
end)
Loading