plugins/comment: Don't write to b.Settings directly

...and use `SetOptionNative()` instead.
This commit is contained in:
Jöran Karl 2024-08-11 17:49:49 +02:00
parent 0542765d95
commit a678d42861

View File

@ -66,9 +66,9 @@ local last_ft
function updateCommentType(buf)
if buf.Settings["commenttype"] == nil or (last_ft ~= buf.Settings["filetype"] and last_ft ~= nil) then
if ft[buf.Settings["filetype"]] ~= nil then
buf.Settings["commenttype"] = ft[buf.Settings["filetype"]]
buf:SetOptionNative("commenttype", ft[buf.Settings["filetype"]])
else
buf.Settings["commenttype"] = "# %s"
buf:SetOptionNative("commenttype", "# %s")
end
last_ft = buf.Settings["filetype"]