diff options
| author | erw7 <erw7.github@gmail.com> | 2020-03-01 20:27:19 +0900 |
|---|---|---|
| committer | erw7 <erw7.github@gmail.com> | 2020-03-01 20:27:19 +0900 |
| commit | dc1c93f459577d2c04cedda212d303129de2c804 (patch) | |
| tree | 5d10467d335929006bdd7533079f3312c911fa4d /lua/nvim_lsp/util.lua | |
| parent | [docgen] Update README.md (diff) | |
| download | nvim-lspconfig-dc1c93f459577d2c04cedda212d303129de2c804.tar nvim-lspconfig-dc1c93f459577d2c04cedda212d303129de2c804.tar.gz nvim-lspconfig-dc1c93f459577d2c04cedda212d303129de2c804.tar.bz2 nvim-lspconfig-dc1c93f459577d2c04cedda212d303129de2c804.tar.lz nvim-lspconfig-dc1c93f459577d2c04cedda212d303129de2c804.tar.xz nvim-lspconfig-dc1c93f459577d2c04cedda212d303129de2c804.tar.zst nvim-lspconfig-dc1c93f459577d2c04cedda212d303129de2c804.zip | |
Fix problems when relative paths are passed
Diffstat (limited to 'lua/nvim_lsp/util.lua')
| -rw-r--r-- | lua/nvim_lsp/util.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lua/nvim_lsp/util.lua b/lua/nvim_lsp/util.lua index 433bcab2..82767905 100644 --- a/lua/nvim_lsp/util.lua +++ b/lua/nvim_lsp/util.lua @@ -128,6 +128,14 @@ M.path = (function() end end + local function is_absolute(filename) + if is_windows then + return filename:match("^%a:") or filename:match("^\\\\") + else + return filename:match("^/") + end + end + local dirname do local strip_dir_pat = path_sep.."([^"..path_sep.."]+)$" @@ -195,6 +203,7 @@ M.path = (function() return { is_dir = is_dir; is_file = is_file; + is_absolute = is_absolute; exists = exists; sep = path_sep; dirname = dirname; |
