refactor: Jumplist picker uses quickfix entry maker. Delete jumplist entry maker. (#973)

This commit is contained in:
caojoshua
2021-07-10 23:24:57 -07:00
committed by GitHub
parent 7cdaaaa39d
commit dc0dca27dc
2 changed files with 6 additions and 50 deletions

View File

@@ -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