Hi.
I propose new conversion specifier '%v' (and '%V') of printf(); inspired by
golang.
This spec takes a value of any type and converts into string by echo_string().
example:
" list
:echo printf('%v', [0, 1, 2, 3])
[0, 1, 2, 3]
" dict
:echo printf('%v', {'str' : 'abcdef', 'num' : 123, 'pt' : function('printf',
['%%'])})
{'str': 'abcdef', 'num': 123, 'pt': function('printf', ['%%'])}
" funcref
:echo printf('%v', function('str2nr'))
str2nr
'%V' is simular with '%S'.
patch:
https://gist.github.com/ichizok/c1ad7759d7a0a0734fb02f5a4d37445c
Thank you.
- Ozaki Kiichi
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.