fix: check if cmd extension can be loaded - fix lazy loading of extensions (#2655)

As a last resort if no other cmd is found in `run_cmd`, check
if the command can be loaded as an extension.

(cherry picked from commit a19770625a)
This commit is contained in:
Will Hopkins
2023-09-10 03:23:28 -07:00
committed by Simon Hauser
parent 2d0e6fd49c
commit d90956833d
+6
View File
@@ -194,6 +194,12 @@ local function run_command(args)
return
end
local ok = pcall(require("telescope").load_extension, cmd)
if ok then
extensions[cmd][cmd](opts)
return
end
utils.notify("run_command", {
msg = "Unknown command",
level = "ERROR",