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

feature: Reverse label order

Open TommyAmberson opened this issue 8 months ago • 2 comments

Did you check the docs?

  • [x] I have read all the flash.nvim docs

Is your feature request related to a problem? Please describe.

I like to have the telescope results as a 'dropup' (instead of a dropdown) ...

Image

but the labels are added from the top. This is annoying because the label order is there for a reason to make the easier keys more common. In the telescope integration I usually even have to use Uppercase keys.

Describe the solution you'd like

I'd really like a way to just start the labels from the bottom.

Describe alternatives you've considered

I tried adding forward = false but that did not change anything. Does this do anything for other windows?

Additional context

My flash command:

	require("flash").jump({
		pattern = "^ *[^ ]",
		label = { before = true, after = false, style = "inline" },
		search = {
			forward = false,
			mode = "search",
			exclude = {
				function(win)
					return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "TelescopeResults"
				end,
			},
		},
		highlight = { matches = false },
		action = function(match)
			local picker = require("telescope.actions.state").get_current_picker(prompt_bufnr)
			picker:set_selection(match.pos[1] - 1)
		end,
	})

(note that I customized the pattern but that shouldn't effect this issue)

TommyAmberson avatar Mar 27 '25 23:03 TommyAmberson

I had the same issue, I worked around it by adding an argument to jump:

                labels = (labels .. labels:upper()):reverse(),

where labels is your string of labels. The labels string needs to be long enough to cover all the picker lines; concatenating the upper case labels helps with this

rynoV avatar Apr 07 '25 18:04 rynoV

I thought of that too but if there are only a few results (for example if I am using the buffer picker) then I only get the uppercase rarely used letters

Image

TommyAmberson avatar Apr 08 '25 23:04 TommyAmberson

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar May 09 '25 02:05 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar May 16 '25 02:05 github-actions[bot]