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 description for additional mappings #2981
Comments
we kinda already support this but i think not consistently, or there is some bug. e.g. it doesnt work for can you provide the additional mappings that you've added? because i think there should never be a |
Came here to comment the same issue. Here's a not-so-minimal example pickers.new(
opts,
{
prompt_title = "Session Viewer",
finder = finders.new_table(
{
results = vim.tbl_flatten(sessions),
entry_maker = function(entry)
-- ... More stuff here ...
return result
end,
}
),
sorter = telescope_config.file_sorter(opts),
attach_mappings = function(prompt_buffer, map)
map(
"n",
"n",
function() _USE_NICE_NAMES = not _USE_NICE_NAMES end,
-- NOTE: `desc` is currently unsupported by telescope.nvim
-- Reference: https://github.com/nvim-telescope/telescope.nvim/issues/2981
--
{desc = "Toggle [n]ice names or full path displays."}
)
map(
"i",
"<CR>",
function()
actions.close(prompt_buffer)
local selection = state.get_selected_entry()
-- Schedule buffers cleanup to avoid callback issues and source the session
vim.schedule(
function()
local path = selection.value
configuration.DATA.run_pre_switch_hook(path)
vim.cmd.wall()
vim.cmd[[%bwipeout]]
vim.cmd.source(path)
configuration.DATA.run_post_switch_hook(path)
end
)
end,
-- NOTE: `desc` is currently unsupported by telescope.nvim
-- Reference: https://github.com/nvim-telescope/telescope.nvim/issues/2981
--
{desc = "Select a session to load."}
)
return true
end,
}):find() When you press |
Is your feature request related to a problem? Please describe.
When adding
mappings
in the configuration of apicker
, there does not seem to be a way for providing a description that would be rendered bywhich_key
.Describe the solution you'd like
Ideally, a description could be provided under
desc
in theopts
of the mapping, to mimick the standard way.Additional context
Without a description,
which_key
shows as a description some gibberish like_13_
.The text was updated successfully, but these errors were encountered: