1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 05:40:05 +08:00
SpaceVim/bundle/plenary.nvim/lua/plenary/debug_utils.lua
2022-05-16 22:20:10 +08:00

14 lines
283 B
Lua

local debug_utils = {}
function debug_utils.sourced_filepath()
local str = debug.getinfo(2, "S").source:sub(2)
return str
end
function debug_utils.sourced_filename()
local str = debug_utils.sourced_filepath()
return str:match "^.*/(.*).lua$" or str
end
return debug_utils