Fix getting comment string

This commit is contained in:
Stephen Seo 2022-11-03 11:41:27 +09:00
parent 4ea6f9b7ab
commit 079fed75a5
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,8 @@ vim.g.quickcomment_escapecommentstring = function(comment_string)
end
vim.g.quickcomment_getcommentstr = function ()
local comment_string = vim.api.nvim_buf_get_option(0, 'comments')
local comment_string = vim.api.nvim_buf_get_option(0, 'commentstring')
comment_string = comment_string:gsub('%%s', '')
local has_comment = string.find(comment_string, ',')
if has_comment ~= nil and has_comment > 1 then
comment_string = string.sub(comment_string, 1, has_comment - 1)