Fix different type checks for whitespaceprefix var

This commit is contained in:
Stephen Seo 2022-11-19 18:30:02 +09:00
parent a18bcbad4f
commit 6a4fc20756

View file

@ -90,13 +90,13 @@ vim.g.quickcomment_togglecommentlines = function (line_start, line_end)
local escaped_string_prefix = '' local escaped_string_prefix = ''
if vim.b.quickcomment_whitespaceprefix ~= nil then if vim.b.quickcomment_whitespaceprefix ~= nil then
if vim.b.quickcomment_whitespaceprefix ~= 0 if (type(vim.b.quickcomment_whitespaceprefix) == 'number' and vim.b.quickcomment_whitespaceprefix ~= 0)
or vim.b.quickcomment_whitespaceprefix == true then or (type(vim.b.quickcomment_whitespaceprefix) == 'boolean' and vim.b.quickcomment_whitespaceprefix == true) then
escaped_string_prefix = '%s*' escaped_string_prefix = '%s*'
end end
elseif vim.g.quickcomment_whitespaceprefix ~= nil elseif vim.g.quickcomment_whitespaceprefix ~= nil
and vim.g.quickcomment_whitespaceprefix ~= 0 and (type(vim.g.quickcomment_whitespaceprefix) == 'number' and vim.g.quickcomment_whitespaceprefix ~= 0)
or vim.g.quickcomment_whitespaceprefix == true then or (type(vim.g.quickcomment_whitespaceprefix) == 'boolean' and vim.g.quickcomment_whitespaceprefix == true) then
escaped_string_prefix = '%s*' escaped_string_prefix = '%s*'
end end