fix: more autocmds desc fixes (#2049)

This commit is contained in:
Simon Hauser
2022-07-07 22:38:28 +02:00
committed by GitHub
parent 7df6662394
commit 524c4eb7fb

View File

@@ -1178,9 +1178,12 @@ function make_entry.gen_from_autocommands(opts)
return function(entry)
local group_name = vim.F.if_nil(entry.group_name, "<anonymous>")
local command = entry.command
if entry.desc and vim.startswith(command, "<lua: ") then
if entry.desc and (entry.callback or vim.startswith(command, "<lua: ")) then
command = entry.desc
end
if command == nil or command == "" then
command = "<lua function>"
end
return make_entry.set_default_entry_mt({
value = {
event = entry.event,