Skip to content
Open
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: 4 additions & 2 deletions lua/virt-column/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ local init = function()
---@diagnostic disable-next-line
return vim.fn.virtcol { i, "$" } - 1
end)
if width < column then
local virt_offset = width - vim.fn.virtcol2col(win, i, 100)
local virt_column = column + virt_offset
if width < virt_column then
local column_index = #colorcolumn - j + 1
pcall(vim.api.nvim_buf_set_extmark, bufnr, M.namespace, i - 1, 0, {
virt_text = {
Expand All @@ -88,7 +90,7 @@ local init = function()
},
virt_text_pos = "overlay",
hl_mode = "combine",
virt_text_win_col = column - 1 - leftcol,
virt_text_win_col = virt_column - 1 - leftcol,
priority = 1,
})
end
Expand Down