mirror of
https://github.com/neovim/neovim.git
synced 2026-10-25 23:20:23 -05:00
refactor(path)!: support RFC3986 in path_with_url() #36564
Problem: Nvim does not recognize URI scheme with numeric characters. While rare, there are URIs that contain numbers (e.g. [ed2k://](https://en.wikipedia.org/wiki/Ed2k_URI_scheme)) and characters like `+` (e.g. `svn+ssh`). I use it in [distant.nvim](https://github.com/chipsenkbeil/distant.nvim) to support multiple, distinct connections using `distant+1234://` as the scheme. Otherwise, if you open a file with the same name & path on two different machines from the same Nvim instance, their buffer names will conflict when just using `distant://`. Solution: Adds full support for detecting URI scheme per [RFC3986](https://www.rfc-editor.org/rfc/rfc3986#section-3.1)
This commit is contained in:
1 parent
b3c099b1dd
commit
c123b7245c
4 files changed
+51
-16
No files matched your search
@@ -445,12 +445,18 @@ func Test_buffer_scheme()
|
||||
set noshellslash
|
||||
%bwipe!
|
||||
let bufnames = [
|
||||
\ #{id: 'ssb0', name: 'test://xyz/foo/ssb0' , match: 1},
|
||||
\ #{id: 'ssb1', name: 'test+abc://xyz/foo/ssb1', match: 0},
|
||||
\ #{id: 'ssb2', name: 'test_abc://xyz/foo/ssb2', match: 0},
|
||||
\ #{id: 'ssb3', name: 'test-abc://xyz/foo/ssb3', match: 1},
|
||||
\ #{id: 'ssb4', name: '-test://xyz/foo/ssb4' , match: 0},
|
||||
\ #{id: 'ssb5', name: 'test-://xyz/foo/ssb5' , match: 0},
|
||||
\ #{id: 'ssb0' , name: 'test://xyz/foo/ssb0' , match: 1},
|
||||
\ #{id: 'ssb1' , name: 'test1234://xyz/foo/ssb1', match: 1},
|
||||
\ #{id: 'ssb2' , name: 'test+abc://xyz/foo/ssb2', match: 1},
|
||||
\ #{id: 'ssb3' , name: 'test-abc://xyz/foo/ssb3', match: 1},
|
||||
\ #{id: 'ssb4' , name: 'test.abc://xyz/foo/ssb4', match: 1},
|
||||
\ #{id: 'ssb5' , name: 'test_abc://xyz/foo/ssb5', match: 0},
|
||||
\ #{id: 'ssb6' , name: '+test://xyz/foo/ssb6' , match: 0},
|
||||
\ #{id: 'ssb7' , name: 'test+://xyz/foo/ssb7' , match: 0},
|
||||
\ #{id: 'ssb8' , name: '-test://xyz/foo/ssb8' , match: 0},
|
||||
\ #{id: 'ssb9' , name: 'test-://xyz/foo/ssb9' , match: 0},
|
||||
\ #{id: 'ssb10', name: '.test://xyz/foo/ssb10' , match: 0},
|
||||
\ #{id: 'ssb11', name: 'test.://xyz/foo/ssb11' , match: 0},
|
||||
\]
|
||||
for buf in bufnames
|
||||
new `=buf.name`
|
||||
|
||||
Reference in new issue
Block a user