feat: check if cmd extension can be loaded (#2655)

As a last resort if no other cmd is found in `run_cmd`, check
if the command can be loaded as an extension.
This commit is contained in:
Will Hopkins
2023-09-10 03:23:28 -07:00
committed by GitHub
parent 08e6d7904d
commit a19770625a

View File

@@ -194,6 +194,12 @@ local function run_command(args)
return return
end end
local ok = pcall(require("telescope").load_extension, cmd)
if ok then
extensions[cmd][cmd](opts)
return
end
utils.notify("run_command", { utils.notify("run_command", {
msg = "Unknown command", msg = "Unknown command",
level = "ERROR", level = "ERROR",