Skip to content

Commit

Permalink
fix: check if cmd extension can be loaded - fix lazy loading of exten…
Browse files Browse the repository at this point in the history
…sions (#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 a197706)
  • Loading branch information
willothy authored and Conni2461 committed Nov 28, 2023
1 parent 2d0e6fd commit d909568
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 d909568

Please sign in to comment.