From 5f8949656acb8b2a850d59f685865938862e4f6d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 19 Jun 2011 02:55:37 +0200 Subject: updated for version 7.3.224 Problem: Can't pass dict to sort function. Solution: Add the optional {dict} argument to sort(). (ZyX) --- runtime/doc/eval.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index db5ae56360..01a59bf82f 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1919,7 +1919,8 @@ shellescape( {string} [, {special}]) simplify( {filename}) String simplify filename as much as possible sin( {expr}) Float sine of {expr} sinh( {expr}) Float hyperbolic sine of {expr} -sort( {list} [, {func}]) List sort {list}, using {func} to compare +sort( {list} [, {func} [, {dict}]]) + List sort {list}, using {func} to compare soundfold( {word}) String sound-fold {word} spellbadword() String badly spelled word at cursor spellsuggest( {word} [, {max} [, {capital}]]) @@ -5275,7 +5276,7 @@ sinh({expr}) *sinh()* {only available when compiled with the |+float| feature} -sort({list} [, {func}]) *sort()* *E702* +sort({list} [, {func} [, {dict}]]) *sort()* *E702* Sort the items in {list} in-place. Returns {list}. If you want a list to remain unmodified make a copy first: > :let sortedlist = sort(copy(mylist)) @@ -5283,6 +5284,8 @@ sort({list} [, {func}]) *sort()* *E702* Numbers sort after Strings, |Lists| after Numbers. For sorting text in the current buffer use |:sort|. When {func} is given and it is one then case is ignored. + {dict} is for functions with the "dict" attribute. It will be + used to set the local variable "self". |Dictionary-function| When {func} is a |Funcref| or a function name, this function is called to compare items. The function is invoked with two items as argument and must return zero if they are equal, 1 or -- cgit v1.2.3