Fix detection of colon separator in comment string

This commit is contained in:
Stephen Seo 2022-11-03 11:31:15 +09:00
parent e5227c8035
commit e39309a42e
1 changed files with 3 additions and 2 deletions

View File

@ -24,8 +24,9 @@ vim.g.quickcomment_getcommentstr = function ()
comment_string = string.sub(comment_string, 1, has_comment - 1)
end
if string.sub(comment_string, 1, 1) == ':' then
comment_string = string.sub(comment_string, 2)
local colon_idx = string.find(comment_string, ':')
if colon_idx ~= nil then
comment_string = string.sub(comment_string, colon_idx + 1)
end
if string.len(comment_string) == 0 then