From bfbf5fbd39fa75847bf23da2c46d12fe2728fb78 Mon Sep 17 00:00:00 2001 From: William Boman Date: Wed, 1 Sep 2021 10:29:23 +0200 Subject: add Windows support (#70) --- lua/nvim-lsp-installer/path.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lua/nvim-lsp-installer/path.lua') diff --git a/lua/nvim-lsp-installer/path.lua b/lua/nvim-lsp-installer/path.lua index 25498beb..4ed3d563 100644 --- a/lua/nvim-lsp-installer/path.lua +++ b/lua/nvim-lsp-installer/path.lua @@ -32,11 +32,12 @@ end -- @return The realpath (absolute path). Note that this will currently produce results such as /Users/zuck/./script.js which may not be compatible with some tools. function M.realpath(relpath, depth) local callsite_abs_path = debug.getinfo(depth or 2, "S").source:sub(2) - return M.concat { vim.fn.fnamemodify(callsite_abs_path, ":h"), relpath } + local normalized_relpath = relpath:gsub("./", "") + return M.concat { vim.fn.fnamemodify(callsite_abs_path, ":h"), normalized_relpath } end function M.is_subdirectory(root_path, path) - return path:find(root_path) == 1 + return path:sub(1, #root_path) == root_path end M.SERVERS_ROOT_DIR = M.concat { vim.fn.stdpath "data", "lsp_servers" } -- cgit v1.2.3-70-g09d2