feat: added support for Windows

This commit is contained in:
Folke Lemaitre 2022-12-20 07:19:55 +01:00
parent 198963fdab
commit bb1c2f4c3e
No known key found for this signature in database
GPG key ID: 36B7C1C85AAC487F
3 changed files with 12 additions and 5 deletions

View file

@ -220,12 +220,13 @@ function M:reason(reason, opts)
---@type string?
local source = reason.source
if source then
source = Util.norm(source)
local plugin = Plugin.find(source)
if plugin then
reason.plugin = plugin.name
reason.source = nil
else
local config = vim.fn.stdpath("config")
local config = Util.norm(vim.fn.stdpath("config"))
if source == config .. "/init.lua" then
reason.source = "init.lua"
else
@ -237,6 +238,7 @@ function M:reason(reason, opts)
end
end
if reason.runtime then
reason.runtime = Util.norm(reason.runtime)
reason.runtime = reason.runtime:gsub(".*/([^/]+/plugin/.*)", "%1")
reason.runtime = reason.runtime:gsub(".*/([^/]+/after/.*)", "%1")
reason.runtime = reason.runtime:gsub(".*/([^/]+/ftdetect/.*)", "%1")