diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2020-07-31 00:05:22 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2020-07-31 00:05:22 -0400 |
| commit | fa0382d93e73b66e7ec769cec27b9fbb21020641 (patch) | |
| tree | 624d5dc3de80426956a1c46447f1f26443a87a64 /scratch/file_finder.lua | |
| parent | ababfbfd88334ca6d94d5d0a8b6324dd6600d602 (diff) | |
Streamed some refactoring. More work to do
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 { |
