fix: previewer for builtin.builtin (#1583)

This commit is contained in:
smhc
2021-12-10 20:44:50 +10:00
committed by GitHub
parent 3f4ee6f267
commit 991d0127f0

View File

@@ -563,7 +563,7 @@ previewers.builtin = defaulter(function(_)
end,
define_preview = function(self, entry, status)
local module_name = vim.fn.fnamemodify(entry.filename, ":t:r")
local module_name = vim.fn.fnamemodify(vim.fn.fnamemodify(entry.filename, ":h"), ":t")
local text
if entry.text:sub(1, #module_name) ~= module_name then
text = module_name .. "." .. entry.text