telescope.nvim icon indicating copy to clipboard operation
telescope.nvim copied to clipboard

feat: goto next/previous entry from last picker

Open fdschmidt93 opened this issue 2 years ago • 3 comments

40 mins of a bit of telescope hacking :)

Closes #1701

Now you can

local actions = require "telescope.actions"
-- also works for actions.move_selection_previous
local select_next = actions.move_selection_next + actions.select_default
-- .. launch picker
select_next() -- go to next result of last picker

e: goes without saying but this is ulow prio :sweat_smile:

fdschmidt93 avatar May 02 '22 17:05 fdschmidt93

Is there a status update on this? Seems it's been stale for a while.

Wiebesiek avatar Aug 02 '22 01:08 Wiebesiek

I'd be very happy for somebody to take this over assuming @Conni2461 signs off on this being a feature we should incorporate into telescope-core.

It's something users requested here and there and but you can also make the argument we are reinventing the quickfix list here.

fdschmidt93 avatar Aug 03 '22 08:08 fdschmidt93

I'd be very happy for somebody to take this over assuming @Conni2461 signs off on this being a feature we should incorporate into telescope-core.

It's something users requested here and there and but you can also make the argument we are reinventing the quickfix list here.

I'd love to help out with this PR which is the very thing that prevents me from fully switching to Telescope even as file browser but I need some clarification.

In short this PR should allow a behavior similar to quickfixlist's :cnext and :cprev right? I'm a bit confused because the related issue is about restoring the last known state of the picker invoked, but the PR even though related to that seems to have a slightly different scope, namely only allowing to cycle through the entries of the last known state of the picker.

Also I don't get how to test out this feature.

What I'm doing now is (on your branch and with minimal_init.vim):

  1. Running Telescope find_files
  2. Typing some random stuff and selecting the entry
  3. Running the snippet in the PR's description and getting this error:
E5113: Error while calling lua chunk: ...acker/start/telescope.nvim/lua/telescope/actions/set.lua:39: attempt to index a nil value
stack traceback:
        ...acker/start/telescope.nvim/lua/telescope/actions/set.lua:39: in function 'run_replace_or_original'
        ...packer/start/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'shift_selection'
        ...cker/start/telescope.nvim/lua/telescope/actions/init.lua:81: in function 'run_replace_or_original'
        ...packer/start/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'select_next'
        test.lua:13: in main chunk

c3n21 avatar Aug 20 '22 18:08 c3n21

Any update on this PR?

arv-sajeev avatar Jun 14 '23 04:06 arv-sajeev

Sorry, as mentioned before I will not be continuing this. Happy for anyone to take over :)

fdschmidt93 avatar Jun 14 '23 04:06 fdschmidt93