mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2025-12-06 06:46:10 +00:00
fix: handle windows file paths as uris (#2640)
* fix: handle windows file paths as uris * nit: rename FILE_PATH_PATTERN to WINDOWS_ROOT_PATTERN
This commit is contained in:
committed by
GitHub
parent
dc192faceb
commit
bc2330bc9c
@@ -174,8 +174,11 @@ utils.is_path_hidden = function(opts, path_display)
|
||||
end
|
||||
|
||||
local URI_SCHEME_PATTERN = "^([a-zA-Z]+[a-zA-Z0-9.+-]*):.*"
|
||||
local WINDOWS_ROOT_PATTERN = "^[a-zA-Z]:\\"
|
||||
utils.is_uri = function(filename)
|
||||
return filename:match(URI_SCHEME_PATTERN) ~= nil
|
||||
local is_uri_match = filename:match(URI_SCHEME_PATTERN) ~= nil
|
||||
local is_windows_root_match = filename:match(WINDOWS_ROOT_PATTERN)
|
||||
return is_uri_match and not is_windows_root_match
|
||||
end
|
||||
|
||||
local calc_result_length = function(truncate_len)
|
||||
|
||||
Reference in New Issue
Block a user