mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 23:05:40 -04:00
Make the commenttype option useful (#2735)
This commit is contained in:
parent
b0cd92b70f
commit
eb6daab169
@ -60,11 +60,17 @@ ft["zig"] = "// %s"
|
|||||||
ft["zscript"] = "// %s"
|
ft["zscript"] = "// %s"
|
||||||
ft["zsh"] = "# %s"
|
ft["zsh"] = "# %s"
|
||||||
|
|
||||||
|
local last_ft
|
||||||
|
|
||||||
function updateCommentType(buf)
|
function updateCommentType(buf)
|
||||||
if ft[buf.Settings["filetype"]] ~= nil and ft[buf.Settings["filetype"]] ~= nil then
|
if buf.Settings["commenttype"] == nil or last_ft ~= buf.Settings["filetype"] then
|
||||||
buf.Settings["commenttype"] = ft[buf.Settings["filetype"]]
|
if ft[buf.Settings["filetype"]] ~= nil then
|
||||||
elseif buf.Settings["commenttype"] == nil then
|
buf.Settings["commenttype"] = ft[buf.Settings["filetype"]]
|
||||||
buf.Settings["commenttype"] = "# %s"
|
else
|
||||||
|
buf.Settings["commenttype"] = "# %s"
|
||||||
|
end
|
||||||
|
|
||||||
|
last_ft = buf.Settings["filetype"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user