Skip to content

Commit

Permalink
Merge pull request #22 from lukas-reineke/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-reineke authored Feb 24, 2022
2 parents 8b7dd58 + 3b30aa0 commit 29db24c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion doc/virt-column.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


Author: Lukas Reineke <lukas.reineke@protonmail.com>
Version: 1.5.2
Version: 1.5.3

==============================================================================
CONTENTS *virt-column.nvim*
Expand Down Expand Up @@ -88,6 +88,9 @@ virtcolumn *virt-column-virtcolumn*
==============================================================================
4. CHANGELOG *virt-column-changelog*

1.5.3
* ignore `+N` `-N` columns when |textwidth| is 0

1.5.2
* use `default` for |:highlight-link|

Expand Down
12 changes: 10 additions & 2 deletions lua/virt-column/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ M.refresh = function()

for i, c in ipairs(colorcolumn) do
if vim.startswith(c, "+") then
colorcolumn[i] = textwidth + tonumber(c:sub(2))
if textwidth ~= 0 then
colorcolumn[i] = textwidth + tonumber(c:sub(2))
else
colorcolumn[i] = nil
end
elseif vim.startswith(c, "-") then
colorcolumn[i] = textwidth - tonumber(c:sub(2))
if textwidth ~= 0 then
colorcolumn[i] = textwidth - tonumber(c:sub(2))
else
colorcolumn[i] = nil
end
else
colorcolumn[i] = tonumber(c)
end
Expand Down

0 comments on commit 29db24c

Please sign in to comment.