Skip to content

Commit

Permalink
fix: use _G.require instead of lazy require
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 4, 2022
1 parent b09f946 commit b2e2b6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/noice/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function M.setup(opts)
-- require("noice.util").error("Noice needs Neovim >= 0.9.0 (nightly)")
return
end
if not pcall(require, "notify") then
if not pcall(_G.require, "notify") then
require("noice.util").error("Noice needs nvim-notify to work properly")
return
end
Expand Down
2 changes: 1 addition & 1 deletion lua/noice/ui/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function M.handle(event, ...)
local event_group, event_type = event:match("([a-z]+)_(.*)")
local on = "on_" .. event_type

local ok, handler = pcall(require, "noice.ui." .. event_group)
local ok, handler = pcall(_G.require, "noice.ui." .. event_group)
if not (ok and type(handler[on]) == "function") then
if Config.options.debug then
Util.error("No ui router for **" .. event .. "** events\n```lua\n" .. vim.inspect({ ... }) .. "\n```")
Expand Down

0 comments on commit b2e2b6d

Please sign in to comment.