fix follow-up picker for nvim-0.7 nightly with latest telescope

This commit is contained in:
Rene Schallner
2022-01-19 08:19:32 +01:00
parent 065a449759
commit b8767dd9e3

View File

@@ -2196,10 +2196,11 @@ local function FollowLink(opts)
)
-- builtin.live_grep({
pickers.new({
local picker = pickers.new({
cwd = cwd,
prompt_title = "Notes referencing `" .. title .. "`",
default_text = search_pattern,
initial_mode = "insert",
-- link to specific file (a daily file): [[2021-02-22]]
-- link to heading in specific file (a daily file): [[2021-02-22#Touchpoint]]
-- link to heading globally [[#Touchpoint]]
@@ -2218,7 +2219,8 @@ local function FollowLink(opts)
map("n", "<c-cr>", picker_actions.paste_link(opts))
return true
end,
}):find()
})
picker:find()
end
end
@@ -2451,16 +2453,17 @@ local function FindAllTags(opts)
sorter = conf.generic_sorter(opts),
attach_mappings = function(prompt_bufnr, map)
actions.select_default:replace(function()
actions._close(prompt_bufnr, true)
-- actions for insert tag, default action: search for tag
local selection = action_state.get_selected_entry().value.tag
local follow_opts = {
follow_tag = selection,
show_link_counts = true,
}
actions._close(prompt_bufnr, false)
vim.schedule(function()
FollowLink(follow_opts)
end)
end)
map("i", "<c-y>", picker_actions.yank_tag(opts))
map("i", "<c-i>", picker_actions.paste_tag(opts))
map("n", "<c-y>", picker_actions.yank_tag(opts))