Patch windows (#222)

This commit is contained in:
Federico Scodelaro
2021-03-09 16:12:10 -03:00
committed by GitHub
parent 411e3412d1
commit 31ef294d05
9 changed files with 73 additions and 23 deletions

View File

@@ -11,4 +11,26 @@ function M.echo_warning(msg)
api.nvim_command('echohl None')
end
local path_separator = package.config:sub(1,1)
function M.path_join(paths)
return table.concat(paths, path_separator)
end
function M.path_split(path)
return path:gmatch('[^'..path_separator..']+'..path_separator..'?')
end
function M.path_add_trailing(path)
if path:sub(-1) == path_separator then
return path
end
return path..path_separator
end
function M.path_remove_trailing(path)
return path:gsub(path_separator..'$', '')
end
M.path_separator = path_separator
return M