fix: Rendering sometimes didn't work

This commit is contained in:
TJ DeVries
2020-08-31 22:23:06 -04:00
parent 2d63bca419
commit 8cf3952f27
2 changed files with 25 additions and 6 deletions

View File

@@ -13,9 +13,23 @@ local utils = require('telescope.utils')
local builtin = {}
builtin.git_files = function(opts)
local make_entry = (
opts.shorten_path
and function(value)
local result = {
valid = true,
display = utils.path_shorten(value),
ordinal = value,
value = value
}
return result
end)
or nil
pickers.new(opts, {
prompt = 'Git File',
finder = finders.new_oneshot_job({ "git", "ls-files" }),
finder = finders.new_oneshot_job({ "git", "ls-files" }, make_entry),
previewer = previewers.cat,
sorter = sorters.get_norcalli_sorter(),
}):find()