diff --git a/lua/telescope/builtin/internal.lua b/lua/telescope/builtin/internal.lua index 9df2637..150bfe6 100644 --- a/lua/telescope/builtin/internal.lua +++ b/lua/telescope/builtin/internal.lua @@ -951,15 +951,18 @@ internal.jumplist = function(opts) -- reverse the list local sorted_jumplist = {} for i = #jumplist, 1, -1 do - jumplist[i].text = '' - table.insert(sorted_jumplist, jumplist[i]) + if vim.api.nvim_buf_is_valid(jumplist[i].bufnr) then + jumplist[i].text = vim.api.nvim_buf_get_lines(jumplist[i].bufnr, jumplist[i].lnum, jumplist[i].lnum+1, + false)[1] or '' + table.insert(sorted_jumplist, jumplist[i]) + end end pickers.new(opts, { prompt_title = 'Jumplist', finder = finders.new_table { results = sorted_jumplist, - entry_maker = make_entry.gen_from_jumplist(opts), + entry_maker = make_entry.gen_from_quickfix(opts), }, previewer = conf.qflist_previewer(opts), sorter = conf.generic_sorter(opts), diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index cfe6509..e0b58c6 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -1111,52 +1111,5 @@ function make_entry.gen_from_git_status(opts) end end -function make_entry.gen_from_jumplist(opts) - opts = opts or {} - - local displayer = entry_display.create { - separator = "▏", - items = { - { width = 10 }, - { remaining = true }, - } - } - - local make_display = function(entry) - local filename = utils.transform_path(opts, entry.filename) - - local line_info = {table.concat({entry.lnum, entry.col}, ":"), "TelescopeResultsLineNr"} - - return displayer { - line_info, - filename, - } - end - - return function(entry) - if not vim.api.nvim_buf_is_valid(entry.bufnr) then - return - end - - local filename = entry.filename or vim.api.nvim_buf_get_name(entry.bufnr) - - return { - valid = true, - - value = entry, - ordinal = ( - not opts.ignore_filename and filename - or '' - ) .. ' ' .. entry.text, - display = make_display, - - bufnr = entry.bufnr, - filename = filename, - lnum = entry.lnum, - col = entry.col, - } - end -end - return make_entry