From 8cf3952f27a3f7895100ff547cf1c8cdfeee72f7 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Mon, 31 Aug 2020 22:23:06 -0400 Subject: fix: Rendering sometimes didn't work --- lua/telescope/builtin.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lua/telescope/builtin.lua') diff --git a/lua/telescope/builtin.lua b/lua/telescope/builtin.lua index 43e57fc..5c25663 100644 --- a/lua/telescope/builtin.lua +++ b/lua/telescope/builtin.lua @@ -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() -- cgit v1.2.3