diff options
| author | anott03 <amitav_nott@ryecountryday.org> | 2021-07-14 13:25:00 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-14 19:25:00 +0200 |
| commit | df579bac425e4b6b69a0c8e694b154610cd5420b (patch) | |
| tree | fc4eb1bcbeeabe199bd997757bd72892fb4c07a0 /lua/telescope/algos | |
| parent | a4896e5ef39a8006a8251d48d4cf24aac81a4f94 (diff) | |
refactor: move from telescope.path to plenary.path (#473)
This will deprecate telescope.path, we will remove it soon. Please move over to plenary.path
Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
Diffstat (limited to 'lua/telescope/algos')
| -rw-r--r-- | lua/telescope/algos/fzy.lua | 12 |
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 |
