Fix case where whitespaceprefix variable is 0

This commit is contained in:
Stephen Seo 2022-11-19 18:22:45 +09:00
parent ddeffdce4f
commit a18bcbad4f
1 changed files with 4 additions and 2 deletions

View File

@ -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