From 3640664d067606cba97da7504bbfa2d7c0445f16 Mon Sep 17 00:00:00 2001 From: Lukas Reineke Date: Thu, 24 Feb 2022 15:19:52 +0900 Subject: [PATCH 1/2] ignore `+N` `-N` columns when `textwidth` is 0 fix #21 --- lua/virt-column/init.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/virt-column/init.lua b/lua/virt-column/init.lua index c7e4707..d610e2d 100644 --- a/lua/virt-column/init.lua +++ b/lua/virt-column/init.lua @@ -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 From 3b30aa0565117da4049398a1d41d8394c02b6dc5 Mon Sep 17 00:00:00 2001 From: Lukas Reineke Date: Thu, 24 Feb 2022 15:21:55 +0900 Subject: [PATCH 2/2] Version 1.5.3 * ignore `+N` `-N` columns when `textwidth` is 0 --- doc/virt-column.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/virt-column.txt b/doc/virt-column.txt index 131fedc..8ba4a3e 100644 --- a/doc/virt-column.txt +++ b/doc/virt-column.txt @@ -2,7 +2,7 @@ Author: Lukas Reineke -Version: 1.5.2 +Version: 1.5.3 ============================================================================== CONTENTS *virt-column.nvim* @@ -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|