summaryrefslogtreecommitdiff
path: root/lua/telescope/algos/fzy.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/telescope/algos/fzy.lua')
-rw-r--r--lua/telescope/algos/fzy.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/lua/telescope/algos/fzy.lua b/lua/telescope/algos/fzy.lua
index 93206a9..f6622d0 100644
--- a/lua/telescope/algos/fzy.lua
+++ b/lua/telescope/algos/fzy.lua
@@ -7,10 +7,12 @@
-- > matches on consecutive letters and starts of words. This allows matching
-- > using acronyms or different parts of the path." - J Hawthorn
-local has_path, path = pcall(require, 'telescope.path')
+local has_path, Path = pcall(require, 'plenary.path')
if not has_path then
- path = {
- separator = '/'
+ Path = {
+ path = {
+ separator = '/'
+ }
}
end
@@ -56,10 +58,10 @@ end
local function precompute_bonus(haystack)
local match_bonus = {}
- local last_char = path.separator
+ local last_char = Path.path.sep
for i = 1, string.len(haystack) do
local this_char = haystack:sub(i, i)
- if last_char == path.separator then
+ if last_char == Path.path.sep then
match_bonus[i] = SCORE_MATCH_SLASH
elseif last_char == "-" or last_char == "_" or last_char == " " then
match_bonus[i] = SCORE_MATCH_WORD