vim.uri: fix uri_to_fname (#12059)

fix: #12056
If the colon of the drive letter of windows is URI encoded,
it doesn't match the expected pattern, so decode it first.
This commit is contained in:
Hirokazu Hata
2020-03-30 21:30:24 +09:00
committed by GitHub
parent e700a88bb6
commit 4139678f97
2 changed files with 11 additions and 1 deletions

View File

@@ -85,6 +85,15 @@ describe('URI methods', function()
eq('C:\\Foo\\Bar\\Baz.txt', exec_lua(test_case))
end)
it('file path includes only ascii charactors with encoded colon character', function()
local test_case = [[
local uri = 'file:///C%3A/Foo/Bar/Baz.txt'
return vim.uri_to_fname(uri)
]]
eq('C:\\Foo\\Bar\\Baz.txt', exec_lua(test_case))
end)
it('file path including white space', function()
local test_case = [[
local uri = 'file:///C:/Foo%20/Bar/Baz.txt'