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
6 changes: 3 additions & 3 deletions lua/vgit/git/GitBuffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,11 @@ function GitBuffer:render_conflict_help_text(conflict)
end

if help_text ~= '' then
self.conflict_extmark:text({
self.conflict_extmark:virt_line({
text = help_text,
hl = 'GitComment',
row = current.top - 2,
col = 0,
row = current.top - 1,
above = true,
})
end

Expand Down
18 changes: 18 additions & 0 deletions lua/vgit/ui/Extmark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function Extmark:constructor(bufnr, ns_name_extension)
text = 10,
sign = 100,
lnum = 1000,
virt_line = 10000,
},
ns_id = ns_id,
}
Expand Down Expand Up @@ -91,6 +92,23 @@ function Extmark:text(opts)
})
end

function Extmark:virt_line(opts)
local hl = opts.hl
local row = opts.row
local text = opts.text
local priority = opts.priority
local above = opts.above
if above == nil then above = true end

local id = self:derive_id(row, 'virt_line')
return pcall(vim.api.nvim_buf_set_extmark, self.bufnr, self.ns_id, row, 0, {
id = id,
virt_lines = { { { text, hl } } },
virt_lines_above = above,
priority = priority,
})
end

function Extmark:lnum(opts)
local hl = opts.hl
local row = opts.row
Expand Down