diff options
| author | Oleg Matrokhin <o.matrohin@softpro.com> | 2020-08-30 23:48:46 +0300 |
|---|---|---|
| committer | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-08-30 23:48:11 +0200 |
| commit | cf9df713412491e48ecb69788eae587577f0de81 (patch) | |
| tree | b4e49cb11f7ad761722ecaf82ee954a6e46870a7 /lua/nvim-treesitter | |
| parent | 1cdf8bf7501129154679fdf52dadc0e6c2e6a231 (diff) | |
fix get_package_path function for paths with trailing slash
Diffstat (limited to 'lua/nvim-treesitter')
| -rw-r--r-- | lua/nvim-treesitter/utils.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/nvim-treesitter/utils.lua b/lua/nvim-treesitter/utils.lua index a39dd054..c8f09fe2 100644 --- a/lua/nvim-treesitter/utils.lua +++ b/lua/nvim-treesitter/utils.lua @@ -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 |
