Am 19.08.2014 um 11:17 schrieb mattn:
Keys? v:key is list index, it cannot contain spaces.
Spaces in values shouldn't matter.
Not sure what you mean.
I wonder this won't works correctly.
[{"a": "b"}, {"a b": ""}]
Guessing you want to sort by dict key:
:echo MapSort([{"a": "b"}, {"a b": ""}], 'keys(v:val)[0]')
[{'a': 'b'}, {'a b': ''}]
the following list is given to the sort() function:
:echo map([{"a": "b"}, {"a b": ""}], 'keys(v:val)[0]')
['a', 'a b']
actually within MapSort(), the index is appended:
['a 0', 'a b 1']
(not so nice, but) shouldn't make a difference for sort().
Sorting by dict value:
:echo MapSort([{"a": "b"}, {"a b": ""}], 'values(v:val)[0]')
[{'a b': ''}, {'a': 'b'}]
--
Andy
--
--
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.