Skip to content

Commit

Permalink
feat: check if cmd extension can be loaded (#2655)
Browse files Browse the repository at this point in the history
As a last resort if no other cmd is found in `run_cmd`, check
if the command can be loaded as an extension.
  • Loading branch information
willothy committed Sep 10, 2023
1 parent 08e6d79 commit a197706
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/telescope/command.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a197706

Please sign in to comment.