Closed b1nhack closed 1 month ago
You need to add that code after where you have your telescope spec.
Also, you should use just opts
for your telescope spec, or pass the opts
in the config
function to your telescope setup call.
Here is the full spec.
return {
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
cmd = "Telescope",
opts = function(_, opts)
local function flash(prompt_bufnr)
require("flash").jump({
pattern = "^",
label = { after = { 0, 0 } },
search = {
mode = "search",
exclude = {
function(win)
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "TelescopeResults"
end,
},
},
action = function(match)
local picker = require("telescope.actions.state").get_current_picker(prompt_bufnr)
picker:set_selection(match.pos[1] - 1)
end,
})
end
opts.defaults = vim.tbl_deep_extend("force", opts.defaults or {}, {
mappings = {
n = { s = flash },
i = { ["<c-s>"] = flash },
},
})
end,
}
flash is called correctly, but it looks like flash is searching for Prompt, and after calling flash, the prompt_prefix ">" in Prompt is highlighted as "a".
This is my problem, it is caused by the following option.
multi_window = false,
right, just keep it as true
in the telescope call
Did you check docs and existing issues?
Neovim version (nvim -v)
neovim 7acf39d
Operating system/version
macOS 14.5 23F79 arm64
Describe the bug
flash can't search in telescope. I'm not sure what I'm missing, the code in the documentation is supposed to act as dependencies.
Steps To Reproduce
Make the following code as dependencies for flash
Telescope find_files
Expected Behavior
I should be able to use flash to navigate in the telescope results window!
Repro