mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 03:26:52 -04:00
fix get_package_path function for paths with trailing slash
This commit is contained in:
parent
1cdf8bf750
commit
cf9df71341
1 changed files with 2 additions and 2 deletions
|
|
@ -19,8 +19,8 @@ end
|
|||
|
||||
function M.get_package_path()
|
||||
for _, path in pairs(api.nvim_list_runtime_paths()) do
|
||||
local last_segment = vim.fn.fnamemodify(path, ":t")
|
||||
local penultimate_segment = vim.fn.fnamemodify(path, ":t:t")
|
||||
local last_segment = vim.fn.fnamemodify(path, ":p:h:t")
|
||||
local penultimate_segment = vim.fn.fnamemodify(path, ":p:h:t:t")
|
||||
if last_segment == "nvim-treesitter" or (last_segment == "" and penultimate_segment == "nvim-treesitter") then
|
||||
return path
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue