diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2020-08-31 22:23:06 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2020-08-31 22:23:06 -0400 |
| commit | 8cf3952f27a3f7895100ff547cf1c8cdfeee72f7 (patch) | |
| tree | 22526ff467806642d60eee5ba4ab974be2104bfc /lua/telescope/builtin.lua | |
| parent | 2d63bca419e19a84024fb0e2a18f616e6a6881a7 (diff) | |
fix: Rendering sometimes didn't work
Diffstat (limited to 'lua/telescope/builtin.lua')
| -rw-r--r-- | lua/telescope/builtin.lua | 16 |
1 files changed, 15 insertions, 1 deletions
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() |
