Minor improvements

This commit is contained in:
Olivier Roques
2020-12-30 20:40:40 +01:00
parent 08ae38df69
commit 05deaec00e
3 changed files with 8 additions and 12 deletions

View File

@@ -5,9 +5,9 @@ local function exclude(bufnr)
end
local function get_head(path, tail)
local result = path
for i = 1, #vim.split(tail, '/', true) do
result = fn.fnamemodify(result, ':~:h')
local result = fn.fnamemodify(path, ':p')
for i = 1, #vim.split(tail, '/') do
result = fn.fnamemodify(result, ':h')
end
return fn.fnamemodify(result, ':t')
end