diff options
author | Tyler Miller <tmillr@proton.me> | 2023-08-01 08:28:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-01 08:28:28 -0700 |
commit | 0804034c07ad5883bc653d054e549a87d429a8b7 (patch) | |
tree | bd067936c811a26051f15c37986e0ffe5214cef9 /runtime/doc/lua.txt | |
parent | dfe19d6e0047ea2a2a75dff0c57f4c4de1c0196a (diff) | |
download | rneovim-0804034c07ad5883bc653d054e549a87d429a8b7.tar.gz rneovim-0804034c07ad5883bc653d054e549a87d429a8b7.tar.bz2 rneovim-0804034c07ad5883bc653d054e549a87d429a8b7.zip |
fix(loader): cache path ambiguity #24491
Problem: cache paths are derived by replacing each reserved/filesystem-
path-sensitive char with a `%` char in the original path. With this
method, two different files at two different paths (each containing `%`
chars) can erroneously resolve to the very same cache path in certain
edge-cases.
Solution: derive cache paths by url-encoding the original (path) instead
using `vim.uri_encode()` with `"rfc2396"`. Increment `Loader.VERSION` to
denote this change.
Diffstat (limited to 'runtime/doc/lua.txt')
-rw-r--r-- | runtime/doc/lua.txt | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 96569f8d52..32dcd930bb 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2428,8 +2428,27 @@ vim.loader.reset({path}) *vim.loader.reset()* ============================================================================== Lua module: vim.uri *vim.uri* +vim.uri_decode({str}) *vim.uri_decode()* + URI-decodes a string containing percent escapes. + + Parameters: ~ + • {str} (string) string to decode + + Return: ~ + (string) decoded string + +vim.uri_encode({str}, {rfc}) *vim.uri_encode()* + URI-encodes a string using percent escapes. + + Parameters: ~ + • {str} (string) string to encode + • {rfc} "rfc2396" | "rfc2732" | "rfc3986" | nil + + Return: ~ + (string) encoded string + vim.uri_from_bufnr({bufnr}) *vim.uri_from_bufnr()* - Get a URI from a bufnr + Gets a URI from a bufnr. Parameters: ~ • {bufnr} (integer) @@ -2438,7 +2457,7 @@ vim.uri_from_bufnr({bufnr}) *vim.uri_from_bufnr()* (string) URI vim.uri_from_fname({path}) *vim.uri_from_fname()* - Get a URI from a file path. + Gets a URI from a file path. Parameters: ~ • {path} (string) Path to file @@ -2447,7 +2466,7 @@ vim.uri_from_fname({path}) *vim.uri_from_fname()* (string) URI vim.uri_to_bufnr({uri}) *vim.uri_to_bufnr()* - Get the buffer for a uri. Creates a new unloaded buffer if no buffer for + Gets the buffer for a uri. Creates a new unloaded buffer if no buffer for the uri already exists. Parameters: ~ @@ -2457,7 +2476,7 @@ vim.uri_to_bufnr({uri}) *vim.uri_to_bufnr()* (integer) bufnr vim.uri_to_fname({uri}) *vim.uri_to_fname()* - Get a filename from a URI + Gets a filename from a URI. Parameters: ~ • {uri} (string) |