Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a programmatic way to go to "next" / "previous" telescope result on last cached picker #3331

Open
m-deg opened this issue Oct 17, 2024 · 0 comments
Labels
enhancement Enhancement to performance, inner workings or existent features

Comments

@m-deg
Copy link

m-deg commented Oct 17, 2024

Is your feature request related to a problem? Please describe.
Sometimes I would like to go all over all the telescopes results and perform a fix. Currently, i can do this by sending all telescope results to quick fix list. But this is too slow and requires extra action

Describe the solution you'd like
I would like to bind a key to "go to next result" and "go to previous result" in the last telescope picker (even if the last picker is closed currently)

Describe alternatives you've considered
I tried two alternatives:

  • Using quick fix list: This requires extra action and is too slow.
  • Using telescope.builtin.resume() and action_state.move_selection*() methods: This didn't work. For some reason selection doesn't move.
function M.HandleTelescopeSearchUp()
  local telescope = require('telescope.builtin')
  local action_state = require "telescope.actions.state"
  telescope.resume()

  local prompt_bufnr = vim.api.nvim_get_current_buf()
  local current_picker = action_state.get_current_picker(prompt_bufnr)
  local actions = require "telescope.actions"
  actions.move_selection_next(current_picker.prompt_bufnr)
end

Additional context
Telescope is an awesome plugin. You all rock! This feature will speed me and other telescope lovers up. Would be much appreciated.

@m-deg m-deg added the enhancement Enhancement to performance, inner workings or existent features label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to performance, inner workings or existent features
Projects
None yet
Development

No branches or pull requests

1 participant