Skip to content

Commit 589452d

Browse files
Fixing comment plugin not using user settings correctly
1 parent 21bb61c commit 589452d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

runtime/plugins/comment/comment.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,13 @@ ft["zig"] = "// %s"
6161
ft["zscript"] = "// %s"
6262
ft["zsh"] = "# %s"
6363

64-
local last_ft
65-
6664
function updateCommentType(buf)
67-
if buf.Settings["commenttype"] == nil or (last_ft ~= buf.Settings["filetype"] and last_ft ~= nil) then
65+
if buf.Settings["commenttype"] == nil then
6866
if ft[buf.Settings["filetype"]] ~= nil then
6967
buf.Settings["commenttype"] = ft[buf.Settings["filetype"]]
7068
else
7169
buf.Settings["commenttype"] = "# %s"
7270
end
73-
74-
last_ft = buf.Settings["filetype"]
7571
end
7672
end
7773

0 commit comments

Comments
 (0)