fix: open files under cwd with relative name (#693)
This commit is contained in:
parent
bbfa7cba85
commit
634049414b
2 changed files with 2 additions and 1 deletions
|
|
@ -277,7 +277,7 @@ M.normalize_url = function(url, callback)
|
||||||
local norm_path = util.addslash(fs.os_to_posix_path(realpath))
|
local norm_path = util.addslash(fs.os_to_posix_path(realpath))
|
||||||
callback(scheme .. norm_path)
|
callback(scheme .. norm_path)
|
||||||
else
|
else
|
||||||
callback(realpath)
|
callback(vim.fn.fnamemodify(realpath, ":."))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -168,5 +168,6 @@ a.describe("files adapter", function()
|
||||||
test_util.wait_for_autocmd("BufReadPost")
|
test_util.wait_for_autocmd("BufReadPost")
|
||||||
assert.equals("ruby", vim.bo.filetype)
|
assert.equals("ruby", vim.bo.filetype)
|
||||||
assert.equals(vim.fn.fnamemodify(tmpdir.path, ":p") .. "file.rb", vim.api.nvim_buf_get_name(0))
|
assert.equals(vim.fn.fnamemodify(tmpdir.path, ":p") .. "file.rb", vim.api.nvim_buf_get_name(0))
|
||||||
|
assert.equals(tmpdir.path .. "/file.rb", vim.fn.bufname())
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue