From a18bcbad4fa507010d10c15d4146deade559f0c7 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sat, 19 Nov 2022 18:22:45 +0900 Subject: [PATCH] Fix case where whitespaceprefix variable is 0 --- plugin/quickcomment.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/quickcomment.lua b/plugin/quickcomment.lua index 24cddf7..36093d4 100644 --- a/plugin/quickcomment.lua +++ b/plugin/quickcomment.lua @@ -90,11 +90,13 @@ vim.g.quickcomment_togglecommentlines = function (line_start, line_end) local escaped_string_prefix = '' if vim.b.quickcomment_whitespaceprefix ~= nil then - if vim.b.quickcomment_whitespaceprefix then + if vim.b.quickcomment_whitespaceprefix ~= 0 + or vim.b.quickcomment_whitespaceprefix == true then escaped_string_prefix = '%s*' end elseif vim.g.quickcomment_whitespaceprefix ~= nil - and vim.g.quickcomment_whitespaceprefix then + and vim.g.quickcomment_whitespaceprefix ~= 0 + or vim.g.quickcomment_whitespaceprefix == true then escaped_string_prefix = '%s*' end