mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(uri): change scheme pattern to not include the comma character (#16797)
This commit is contained in:
parent
99526dc9b3
commit
56f3c41f5f
@ -74,8 +74,8 @@ local function uri_from_fname(path)
|
||||
return table.concat(uri_parts)
|
||||
end
|
||||
|
||||
local URI_SCHEME_PATTERN = '^([a-zA-Z]+[a-zA-Z0-9+-.]*):.*'
|
||||
local WINDOWS_URI_SCHEME_PATTERN = '^([a-zA-Z]+[a-zA-Z0-9+-.]*):[a-zA-Z]:.*'
|
||||
local URI_SCHEME_PATTERN = '^([a-zA-Z]+[a-zA-Z0-9.+-]*):.*'
|
||||
local WINDOWS_URI_SCHEME_PATTERN = '^([a-zA-Z]+[a-zA-Z0-9.+-]*):[a-zA-Z]:.*'
|
||||
|
||||
--- Get a URI from a bufnr
|
||||
---@param bufnr number
|
||||
|
@ -155,6 +155,12 @@ describe('URI methods', function()
|
||||
return pcall(vim.uri_to_fname, 'not_an_uri.txt')
|
||||
]])
|
||||
end)
|
||||
|
||||
it('uri_to_fname should not treat comma as a scheme character', function()
|
||||
eq(false, exec_lua [[
|
||||
return pcall(vim.uri_to_fname, 'foo,://bar')
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user