Closed drybalka closed 2 years ago
Sounds good @drybalka! Do you know how to set those names or where that is documented :)
I made a small PR that should fix it. Basically the idea was to first create a local named function and then return it. You can rename them to your liking, I stuck with names from the config.
Oh it uses the name of the function? That's a bit weird, do you know if it's possible to provide an explicit separate name for it instead? I think the code is a bit cleaner without assigning the functions to variables.
Thanks for the PR!
I couldn't find how to provide a function with name otherwise, sorry. Here is where estimation happens in telescope, maybe you'll have an idea how to do it.
Thanks for the reference @drybalka! Looking around a bit more in the source code it seems you can provide a table instead where the first entry is a description which seems to wok. Let me know if #67 does indeed work for you.
Works for me, and the code is indeed cleaner this way =) Thanks! You can close my PR then, I think.
Thanks for checking, I made another change cause I realised that the keybinds were actually not working. Instead I made them now a metatable which seems to work for both the action and the names.
Telescope has a useful feature to show mappings on <?> or (internally called telescope.actions.which_key). However, for neoclip it shows instead of actions (for example, paste or paste_previous) and prints an error "No name available for anonymous functions". It would be great if this worked as intended.