aboutsummaryrefslogtreecommitdiffstats
path: root/lua/common_lsp/util.lua
diff options
context:
space:
mode:
authorAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-13 18:31:52 -0800
committerAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-13 18:31:52 -0800
commitf5cdde6f8334f125c5b251abdb3e6600459ab888 (patch)
treeee24c6ff56e767194c48c1109949b84df4284ac0 /lua/common_lsp/util.lua
parentAdd more instructions for contributions. (diff)
downloadnvim-lspconfig-f5cdde6f8334f125c5b251abdb3e6600459ab888.tar
nvim-lspconfig-f5cdde6f8334f125c5b251abdb3e6600459ab888.tar.gz
nvim-lspconfig-f5cdde6f8334f125c5b251abdb3e6600459ab888.tar.bz2
nvim-lspconfig-f5cdde6f8334f125c5b251abdb3e6600459ab888.tar.lz
nvim-lspconfig-f5cdde6f8334f125c5b251abdb3e6600459ab888.tar.xz
nvim-lspconfig-f5cdde6f8334f125c5b251abdb3e6600459ab888.tar.zst
nvim-lspconfig-f5cdde6f8334f125c5b251abdb3e6600459ab888.zip
Bugfix and indentation
Diffstat (limited to 'lua/common_lsp/util.lua')
-rw-r--r--lua/common_lsp/util.lua26
1 files changed, 13 insertions, 13 deletions
diff --git a/lua/common_lsp/util.lua b/lua/common_lsp/util.lua
index b821854a..9aed25fe 100644
--- a/lua/common_lsp/util.lua
+++ b/lua/common_lsp/util.lua
@@ -124,10 +124,10 @@ M.path = (function()
local strip_sep_pat = path_sep.."$"
dirname = function(path)
local result = path:gsub(strip_sep_pat, ""):gsub(strip_dir_pat, "")
- if #result == 0 then
- return "/"
- end
- return result
+ if #result == 0 then
+ return "/"
+ end
+ return result
end
end
@@ -142,24 +142,24 @@ M.path = (function()
-- Just in case our algo is buggy, don't infinite loop.
for _ = 1, 100 do
dir = dirname(dir)
- -- If we can't ascend further, then stop looking.
+ -- If we can't ascend further, then stop looking.
if cb(dir, path) then
return dir, path
end
- if is_fs_root(dir) then
- break
- end
+ if is_fs_root(dir) then
+ break
+ end
end
end
-- Iterate the path until we find the rootdir.
local function iterate_parents(path)
path = uv.fs_realpath(path)
- local function it(s, v)
- if is_fs_root(v) then return end
- return dirname(v), path
- end
- return it, path, path
+ local function it(s, v)
+ if is_fs_root(v) then return end
+ return dirname(v), path
+ end
+ return it, path, path
end
return {