Skip to content

Commit

Permalink
refactor!: since 5.0 do not longer warn about deprecated `core.norg.*…
Browse files Browse the repository at this point in the history
…` modules
  • Loading branch information
vhyrro committed May 28, 2023
1 parent 962e45a commit 19e0e8a
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions lua/neorg/modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ neorg.modules.loaded_module_count = 0
--- The table of currently loaded modules
neorg.modules.loaded_modules = {}

-- Warns access to `core.norg.foo` modules since they are deprecated in v3.0.0
-- Accesses to `core.foo` automatically instead
setmetatable(neorg.modules.loaded_modules, {
__index = function(orig_tbl, old_key)
if vim.startswith(old_key, "core.norg") then
local new_key = "core" .. string.sub(old_key, 10) -- string.len("core.norg") + 1 == 10
log.warn(string.format("%s is deprecated in Neorg v3.0.0+. Use %s instead.", old_key, new_key))
return orig_tbl[new_key]
end
return nil
end,
})

--- Loads and enables a module
-- Loads a specified module. If the module subscribes to any events then they will be activated too.
---@param module table #The actual module to load
Expand Down

1 comment on commit 19e0e8a

@pysan3
Copy link
Contributor

@pysan3 pysan3 commented on 19e0e8a Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 😃!

Please sign in to comment.