Skip to content

Commit af1a7f0

Browse files
authored
fix: get correct list of ft and cmd from lazy function (#442)
1 parent 8debb17 commit af1a7f0

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

lua/render-markdown/lib/env.lua

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,18 @@ function M.lazy(key)
1010
if type(package.loaded.lazy) ~= 'table' then
1111
return {}
1212
end
13-
local ok, lazy_config = pcall(require, 'lazy.core.config')
14-
if not ok then
13+
local config_ok, lazy_config = pcall(require, 'lazy.core.config')
14+
local plugin_ok, lazy_plugin = pcall(require, 'lazy.core.plugin')
15+
if not config_ok or not plugin_ok then
1516
return {}
1617
end
1718
local name = 'render-markdown.nvim'
1819
local plugin = lazy_config.spec.plugins[name]
1920
if not plugin then
2021
return {}
2122
end
22-
local values = plugin[key]
23-
if type(values) == 'table' then
24-
return values
25-
elseif type(values) == 'string' then
26-
return { values }
27-
else
28-
return {}
29-
end
23+
24+
return lazy_plugin.values(plugin, key, true)
3025
end
3126

3227
---@param file string|integer

0 commit comments

Comments
 (0)