summaryrefslogtreecommitdiff
path: root/scratch/file_finder.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-07-31 00:05:22 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-07-31 00:05:22 -0400
commitfa0382d93e73b66e7ec769cec27b9fbb21020641 (patch)
tree624d5dc3de80426956a1c46447f1f26443a87a64 /scratch/file_finder.lua
parentababfbfd88334ca6d94d5d0a8b6324dd6600d602 (diff)
Streamed some refactoring. More work to do
Diffstat (limited to 'scratch/file_finder.lua')
-rw-r--r--scratch/file_finder.lua13
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 {