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 | |
| parent | C highlights: make `preproc_defined` @function.macro (diff) | |
| download | nvim-treesitter-cf9df713412491e48ecb69788eae587577f0de81.tar nvim-treesitter-cf9df713412491e48ecb69788eae587577f0de81.tar.gz nvim-treesitter-cf9df713412491e48ecb69788eae587577f0de81.tar.bz2 nvim-treesitter-cf9df713412491e48ecb69788eae587577f0de81.tar.lz nvim-treesitter-cf9df713412491e48ecb69788eae587577f0de81.tar.xz nvim-treesitter-cf9df713412491e48ecb69788eae587577f0de81.tar.zst nvim-treesitter-cf9df713412491e48ecb69788eae587577f0de81.zip | |
fix get_package_path function for paths with trailing slash
| -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 a39dd054a..c8f09fe22 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 |
