diff options
Diffstat (limited to 'scratch/file_finder.lua')
| -rw-r--r-- | scratch/file_finder.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scratch/file_finder.lua b/scratch/file_finder.lua index 8b5bb7b..ae84e2f 100644 --- a/scratch/file_finder.lua +++ b/scratch/file_finder.lua @@ -1,3 +1,4 @@ +package.loaded['telescope.pickers'] = nil local telescope = require('telescope') -- Goals: @@ -61,15 +62,15 @@ local file_sorter = telescope.sorters.new { if prompt == '' then return 0 end if not line then return -1 end - local dist = string_distance(prompt, line) - -- if dist > (0.75 * #line) and #prompt > 3 then - -- return -1 - -- end - - return dist + return tonumber(vim.fn.systemlist(string.format( + "echo '%s' | ~/tmp/fuzzy_test/target/debug/fuzzy_test '%s'", + line, + prompt + ))[1]) end } + local file_previewer = telescope.previewers.vim_buffer local file_picker = telescope.pickers.new { |
