Annotating an anonymous function within a function with variable substitution #1791
Unanswered
macintacos
asked this question in
Q&A
Replies: 1 comment
-
Currently, what you are describing can't be achieved. But, of course, you can: -- Convenience function to create a keymap for mode "n"
M.nnoremap = bind("n")
-- Convenience function to create a keymap for mode "i"
M.inoremap = bind("i") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was trying to type the following function:
I then export the function to be used elsewhere like so:
The annotations all work great. However, I was hoping that there would be a way to substitude the
mode
parameter into the inner docstring on the first line (see the"{mode}"
) - is there any way to do that such that it substitutes that variable in the inner anonymous function?Ideally, when retrieving the docstring for the
nnoremap
function, I would see something like:And again, for the docstring for
inoremap
, I would see:I don't expect my current annotation to work - just trying to see if what I want to do is possible. I read the documentation/searched elsewhere and can't find anyone else trying to do the same thing. Any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions