mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-18 14:57:18 +09:00
Don't auto-detect commenttype if last_ft is empty
Also fixes commenttype for batch files. Fixes #2752
This commit is contained in:
@@ -7,7 +7,7 @@ local buffer = import("micro/buffer")
|
||||
local ft = {}
|
||||
|
||||
ft["apacheconf"] = "# %s"
|
||||
ft["bat"] = ":: %s"
|
||||
ft["batch"] = ":: %s"
|
||||
ft["c"] = "// %s"
|
||||
ft["c++"] = "// %s"
|
||||
ft["cmake"] = "# %s"
|
||||
@@ -63,7 +63,7 @@ ft["zsh"] = "# %s"
|
||||
local last_ft
|
||||
|
||||
function updateCommentType(buf)
|
||||
if buf.Settings["commenttype"] == nil or last_ft ~= buf.Settings["filetype"] then
|
||||
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"]]
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user