lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
805f60a
To: vim_dev@googlegroups.com
805f60a
Subject: Patch 7.4.218
805f60a
Fcc: outbox
805f60a
From: Bram Moolenaar <Bram@moolenaar.net>
805f60a
Mime-Version: 1.0
805f60a
Content-Type: text/plain; charset=UTF-8
805f60a
Content-Transfer-Encoding: 8bit
805f60a
------------
805f60a
805f60a
Patch 7.4.218
805f60a
Problem:    It's not easy to remove duplicates from a list.
805f60a
Solution:   Add the uniq() function. (LCD)
805f60a
Files:	    runtime/doc/change.txt, runtime/doc/eval.txt,
805f60a
	    runtime/doc/usr_41.txt, runtime/doc/version7.txt, src/eval.c,
805f60a
	    src/testdir/test55.in, src/testdir/test55.ok
805f60a
805f60a
805f60a
*** ../vim-7.4.217/runtime/doc/change.txt	2013-09-22 15:23:38.000000000 +0200
805f60a
--- runtime/doc/change.txt	2014-03-25 17:32:29.510040841 +0100
805f60a
***************
805f60a
*** 1645,1651 ****
805f60a
  7. Sorting text						*sorting*
805f60a
  
805f60a
  Vim has a sorting function and a sorting command.  The sorting function can be
805f60a
! found here: |sort()|.
805f60a
  
805f60a
  							*:sor* *:sort*
805f60a
  :[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/]
805f60a
--- 1650,1656 ----
805f60a
  7. Sorting text						*sorting*
805f60a
  
805f60a
  Vim has a sorting function and a sorting command.  The sorting function can be
805f60a
! found here: |sort()|, |uniq()|.
805f60a
  
805f60a
  							*:sor* *:sort*
805f60a
  :[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/]
805f60a
*** ../vim-7.4.217/runtime/doc/eval.txt	2014-02-23 23:38:58.820760280 +0100
805f60a
--- runtime/doc/eval.txt	2014-03-25 17:47:18.750054467 +0100
805f60a
***************
805f60a
*** 326,331 ****
805f60a
--- 327,333 ----
805f60a
  Changing the order of items in a list: >
805f60a
  	:call sort(list)		" sort a list alphabetically
805f60a
  	:call reverse(list)		" reverse the order of items
805f60a
+ 	:call uniq(sort(list))		" sort and remove duplicates
805f60a
  
805f60a
  
805f60a
  For loop ~
805f60a
***************
805f60a
*** 1518,1523 ****
805f60a
--- 1520,1526 ----
805f60a
  		startup.  These are the files that Vim remembers marks for.
805f60a
  		The length of the List is limited by the ' argument of the
805f60a
  		'viminfo' option (default is 100).
805f60a
+ 		When the |viminfo| file is not used the List is empty.
805f60a
  		Also see |:oldfiles| and |c_#<|.
805f60a
  		The List can be modified, but this has no effect on what is
805f60a
  		stored in the |viminfo| file later.  If you use values other
805f60a
***************
805f60a
*** 2003,2008 ****
805f60a
--- 2006,2013 ----
805f60a
  type( {name})			Number	type of variable {name}
805f60a
  undofile( {name})		String	undo file name for {name}
805f60a
  undotree()			List	undo file tree
805f60a
+ uniq( {list} [, {func} [, {dict}]])
805f60a
+ 				List	remove adjacent duplicates from a list
805f60a
  values( {dict})			List	values in {dict}
805f60a
  virtcol( {expr})		Number	screen column of cursor or mark
805f60a
  visualmode( [expr])		String	last visual mode used
805f60a
***************
805f60a
*** 5474,5493 ****
805f60a
  
805f60a
  
805f60a
  sort({list} [, {func} [, {dict}]])			*sort()* *E702*
805f60a
! 		Sort the items in {list} in-place.  Returns {list}.  If you
805f60a
! 		want a list to remain unmodified make a copy first: >
805f60a
  			:let sortedlist = sort(copy(mylist))
805f60a
  <		Uses the string representation of each item to sort on.
805f60a
  		Numbers sort after Strings, |Lists| after Numbers.
805f60a
  		For sorting text in the current buffer use |:sort|.
805f60a
  		When {func} is given and it is one then case is ignored.
805f60a
- 		{dict} is for functions with the "dict" attribute.  It will be
805f60a
- 		used to set the local variable "self". |Dictionary-function|
805f60a
  		When {func} is a |Funcref| or a function name, this function
805f60a
  		is called to compare items.  The function is invoked with two
805f60a
  		items as argument and must return zero if they are equal, 1 or
805f60a
  		bigger if the first one sorts after the second one, -1 or
805f60a
  		smaller if the first one sorts before the second one.
805f60a
  		Example: >
805f60a
  			func MyCompare(i1, i2)
805f60a
  			   return a:i1 == a:i2 ? 0 : a:i1 > a:i2 ? 1 : -1
805f60a
--- 5491,5516 ----
805f60a
  
805f60a
  
805f60a
  sort({list} [, {func} [, {dict}]])			*sort()* *E702*
805f60a
! 		Sort the items in {list} in-place.  Returns {list}.
805f60a
! 		
805f60a
! 		If you want a list to remain unmodified make a copy first: >
805f60a
  			:let sortedlist = sort(copy(mylist))
805f60a
  <		Uses the string representation of each item to sort on.
805f60a
  		Numbers sort after Strings, |Lists| after Numbers.
805f60a
  		For sorting text in the current buffer use |:sort|.
805f60a
+ 
805f60a
  		When {func} is given and it is one then case is ignored.
805f60a
  		When {func} is a |Funcref| or a function name, this function
805f60a
  		is called to compare items.  The function is invoked with two
805f60a
  		items as argument and must return zero if they are equal, 1 or
805f60a
  		bigger if the first one sorts after the second one, -1 or
805f60a
  		smaller if the first one sorts before the second one.
805f60a
+ 
805f60a
+ 		{dict} is for functions with the "dict" attribute.  It will be
805f60a
+ 		used to set the local variable "self". |Dictionary-function|
805f60a
+ 
805f60a
+ 		Also see |uniq()|.
805f60a
+ 
805f60a
  		Example: >
805f60a
  			func MyCompare(i1, i2)
805f60a
  			   return a:i1 == a:i2 ? 0 : a:i1 > a:i2 ? 1 : -1
805f60a
***************
805f60a
*** 6155,6160 ****
805f60a
--- 6178,6191 ----
805f60a
  				blocks.  Each item may again have an "alt"
805f60a
  				item.
805f60a
  
805f60a
+ uniq({list} [, {func} [, {dict}]])			*uniq()* *E882*
805f60a
+ 		Remove second and succeeding copies of repeated adjacent
805f60a
+ 		{list} items in-place.  Returns {list}.  If you want a list
805f60a
+ 		to remain unmodified make a copy first: >
805f60a
+ 			:let newlist = uniq(copy(mylist))
805f60a
+ <		The default compare function uses the string representation of
805f60a
+ 		each item.  For the use of {func} and {dict} see |sort()|.
805f60a
+ 
805f60a
  values({dict})						*values()*
805f60a
  		Return a |List| with all the values of {dict}.	The |List| is
805f60a
  		in arbitrary order.
805f60a
*** ../vim-7.4.217/runtime/doc/usr_41.txt	2013-08-10 13:25:05.000000000 +0200
805f60a
--- runtime/doc/usr_41.txt	2014-03-25 17:32:29.518040841 +0100
805f60a
***************
805f60a
*** 1,4 ****
805f60a
! *usr_41.txt*	For Vim version 7.4.  Last change: 2013 Feb 20
805f60a
  
805f60a
  		     VIM USER MANUAL - by Bram Moolenaar
805f60a
  
805f60a
--- 1,4 ----
805f60a
! *usr_41.txt*	For Vim version 7.4.  Last change: 2014 Jan 10
805f60a
  
805f60a
  		     VIM USER MANUAL - by Bram Moolenaar
805f60a
  
805f60a
***************
805f60a
*** 595,607 ****
805f60a
  	matchlist()		like matchstr() and also return submatches
805f60a
  	stridx()		first index of a short string in a long string
805f60a
  	strridx()		last index of a short string in a long string
805f60a
! 	strlen()		length of a string
805f60a
  	substitute()		substitute a pattern match with a string
805f60a
  	submatch()		get a specific match in ":s" and substitute()
805f60a
  	strpart()		get part of a string
805f60a
  	expand()		expand special keywords
805f60a
  	iconv()			convert text from one encoding to another
805f60a
  	byteidx()		byte index of a character in a string
805f60a
  	repeat()		repeat a string multiple times
805f60a
  	eval()			evaluate a string expression
805f60a
  
805f60a
--- 595,611 ----
805f60a
  	matchlist()		like matchstr() and also return submatches
805f60a
  	stridx()		first index of a short string in a long string
805f60a
  	strridx()		last index of a short string in a long string
805f60a
! 	strlen()		length of a string in bytes
805f60a
! 	strchars()		length of a string in characters
805f60a
! 	strwidth()		size of string when displayed
805f60a
! 	strdisplaywidth()	size of string when displayed, deals with tabs
805f60a
  	substitute()		substitute a pattern match with a string
805f60a
  	submatch()		get a specific match in ":s" and substitute()
805f60a
  	strpart()		get part of a string
805f60a
  	expand()		expand special keywords
805f60a
  	iconv()			convert text from one encoding to another
805f60a
  	byteidx()		byte index of a character in a string
805f60a
+ 	byteidxcomp()		like byteidx() but count composing characters
805f60a
  	repeat()		repeat a string multiple times
805f60a
  	eval()			evaluate a string expression
805f60a
  
805f60a
***************
805f60a
*** 619,624 ****
805f60a
--- 623,629 ----
805f60a
  	map()			change each List item
805f60a
  	sort()			sort a List
805f60a
  	reverse()		reverse the order of a List
805f60a
+ 	uniq()			remove copies of repeated adjacent items
805f60a
  	split()			split a String into a List
805f60a
  	join()			join List items into a String
805f60a
  	range()			return a List with a sequence of numbers
805f60a
***************
805f60a
*** 656,661 ****
805f60a
--- 661,669 ----
805f60a
  	ceil()			round up
805f60a
  	floor()			round down
805f60a
  	trunc()			remove value after decimal point
805f60a
+ 	fmod()			remainder of division
805f60a
+ 	exp()			exponential
805f60a
+ 	log()			natural logarithm (logarithm to base e)
805f60a
  	log10()			logarithm to base 10
805f60a
  	pow()			value of x to the exponent y
805f60a
  	sqrt()			square root
805f60a
***************
805f60a
*** 675,680 ****
805f60a
--- 683,689 ----
805f60a
  	invert()		bitwise invert
805f60a
  	or()			bitwise OR
805f60a
  	xor()			bitwise XOR
805f60a
+ 	sha256()		SHA-256 hash
805f60a
  
805f60a
  Variables:						*var-functions*
805f60a
  	type()			type of a variable
805f60a
***************
805f60a
*** 697,707 ****
805f60a
--- 706,720 ----
805f60a
  	wincol()		window column number of the cursor
805f60a
  	winline()		window line number of the cursor
805f60a
  	cursor()		position the cursor at a line/column
805f60a
+ 	screencol()		get screen column of the cursor
805f60a
+ 	screenrow()		get screen row of the cursor
805f60a
  	getpos()		get position of cursor, mark, etc.
805f60a
  	setpos()		set position of cursor, mark, etc.
805f60a
  	byte2line()		get line number at a specific byte count
805f60a
  	line2byte()		byte count at a specific line
805f60a
  	diff_filler()		get the number of filler lines above a line
805f60a
+ 	screenattr()		get attribute at a screen line/row
805f60a
+ 	screenchar()		get character code at a screen line/row
805f60a
  
805f60a
  Working with text in the current buffer:		*text-functions*
805f60a
  	getline()		get a line or list of lines from the buffer
805f60a
***************
805f60a
*** 883,896 ****
805f60a
--- 896,917 ----
805f60a
  	libcall()		call a function in an external library
805f60a
  	libcallnr()		idem, returning a number
805f60a
  
805f60a
+ 	undofile()		get the name of the undo file
805f60a
+ 	undotree()		return the state of the undo tree
805f60a
+ 
805f60a
  	getreg()		get contents of a register
805f60a
  	getregtype()		get type of a register
805f60a
  	setreg()		set contents and type of a register
805f60a
  
805f60a
+ 	shiftwidth()		effective value of 'shiftwidth'
805f60a
+ 
805f60a
  	taglist()		get list of matching tags
805f60a
  	tagfiles()		get a list of tags files
805f60a
  
805f60a
+ 	luaeval()		evaluate Lua expression
805f60a
  	mzeval()		evaluate |MzScheme| expression
805f60a
+ 	py3eval()		evaluate Python expression (|+python3|)
805f60a
+ 	pyeval()		evaluate Python expression (|+python|)
805f60a
  
805f60a
  ==============================================================================
805f60a
  *41.7*	Defining a function
805f60a
*** ../vim-7.4.217/runtime/doc/version7.txt	2013-08-10 14:23:06.000000000 +0200
805f60a
--- runtime/doc/version7.txt	2014-03-25 17:32:29.518040841 +0100
805f60a
***************
805f60a
*** 942,947 ****
805f60a
--- 942,948 ----
805f60a
  |tagfiles()|		List with tags file names
805f60a
  |taglist()|		get list of matching tags (Yegappan Lakshmanan)
805f60a
  |tr()|			translate characters (Ron Aaron)
805f60a
+ |uniq()|		remove copies of repeated adjacent list items
805f60a
  |values()|		get List of Dictionary values
805f60a
  |winnr()|		takes an argument: what window to use
805f60a
  |winrestview()|		restore the view of the current window
805f60a
*** ../vim-7.4.217/src/eval.c	2014-03-23 15:12:29.915264336 +0100
805f60a
--- src/eval.c	2014-03-25 17:52:09.554058923 +0100
805f60a
***************
805f60a
*** 744,749 ****
805f60a
--- 744,750 ----
805f60a
  static void f_type __ARGS((typval_T *argvars, typval_T *rettv));
805f60a
  static void f_undofile __ARGS((typval_T *argvars, typval_T *rettv));
805f60a
  static void f_undotree __ARGS((typval_T *argvars, typval_T *rettv));
805f60a
+ static void f_uniq __ARGS((typval_T *argvars, typval_T *rettv));
805f60a
  static void f_values __ARGS((typval_T *argvars, typval_T *rettv));
805f60a
  static void f_virtcol __ARGS((typval_T *argvars, typval_T *rettv));
805f60a
  static void f_visualmode __ARGS((typval_T *argvars, typval_T *rettv));
805f60a
***************
805f60a
*** 8150,8155 ****
805f60a
--- 8151,8157 ----
805f60a
      {"type",		1, 1, f_type},
805f60a
      {"undofile",	1, 1, f_undofile},
805f60a
      {"undotree",	0, 0, f_undotree},
805f60a
+     {"uniq",		1, 3, f_uniq},
805f60a
      {"values",		1, 1, f_values},
805f60a
      {"virtcol",		1, 1, f_virtcol},
805f60a
      {"visualmode",	0, 1, f_visualmode},
805f60a
***************
805f60a
*** 17023,17032 ****
805f60a
  static char_u	*item_compare_func;
805f60a
  static dict_T	*item_compare_selfdict;
805f60a
  static int	item_compare_func_err;
805f60a
  #define ITEM_COMPARE_FAIL 999
805f60a
  
805f60a
  /*
805f60a
!  * Compare functions for f_sort() below.
805f60a
   */
805f60a
      static int
805f60a
  #ifdef __BORLANDC__
805f60a
--- 17025,17035 ----
805f60a
  static char_u	*item_compare_func;
805f60a
  static dict_T	*item_compare_selfdict;
805f60a
  static int	item_compare_func_err;
805f60a
+ static void	do_sort_uniq __ARGS((typval_T *argvars, typval_T *rettv, int sort));
805f60a
  #define ITEM_COMPARE_FAIL 999
805f60a
  
805f60a
  /*
805f60a
!  * Compare functions for f_sort() and f_uniq() below.
805f60a
   */
805f60a
      static int
805f60a
  #ifdef __BORLANDC__
805f60a
***************
805f60a
*** 17100,17108 ****
805f60a
   * "sort({list})" function
805f60a
   */
805f60a
      static void
805f60a
! f_sort(argvars, rettv)
805f60a
      typval_T	*argvars;
805f60a
      typval_T	*rettv;
805f60a
  {
805f60a
      list_T	*l;
805f60a
      listitem_T	*li;
805f60a
--- 17103,17112 ----
805f60a
   * "sort({list})" function
805f60a
   */
805f60a
      static void
805f60a
! do_sort_uniq(argvars, rettv, sort)
805f60a
      typval_T	*argvars;
805f60a
      typval_T	*rettv;
805f60a
+     int		sort;
805f60a
  {
805f60a
      list_T	*l;
805f60a
      listitem_T	*li;
805f60a
***************
805f60a
*** 17111,17122 ****
805f60a
      long	i;
805f60a
  
805f60a
      if (argvars[0].v_type != VAR_LIST)
805f60a
! 	EMSG2(_(e_listarg), "sort()");
805f60a
      else
805f60a
      {
805f60a
  	l = argvars[0].vval.v_list;
805f60a
  	if (l == NULL || tv_check_lock(l->lv_lock,
805f60a
! 					     (char_u *)_("sort() argument")))
805f60a
  	    return;
805f60a
  	rettv->vval.v_list = l;
805f60a
  	rettv->v_type = VAR_LIST;
805f60a
--- 17115,17126 ----
805f60a
      long	i;
805f60a
  
805f60a
      if (argvars[0].v_type != VAR_LIST)
805f60a
! 	EMSG2(_(e_listarg), sort ? "sort()" : "uniq()");
805f60a
      else
805f60a
      {
805f60a
  	l = argvars[0].vval.v_list;
805f60a
  	if (l == NULL || tv_check_lock(l->lv_lock,
805f60a
! 	       (char_u *)(sort ? _("sort() argument") : _("uniq() argument"))))
805f60a
  	    return;
805f60a
  	rettv->vval.v_list = l;
805f60a
  	rettv->v_type = VAR_LIST;
805f60a
***************
805f60a
*** 17163,17191 ****
805f60a
  	ptrs = (listitem_T **)alloc((int)(len * sizeof(listitem_T *)));
805f60a
  	if (ptrs == NULL)
805f60a
  	    return;
805f60a
- 	i = 0;
805f60a
- 	for (li = l->lv_first; li != NULL; li = li->li_next)
805f60a
- 	    ptrs[i++] = li;
805f60a
  
805f60a
! 	item_compare_func_err = FALSE;
805f60a
! 	/* test the compare function */
805f60a
! 	if (item_compare_func != NULL
805f60a
! 		&& item_compare2((void *)&ptrs[0], (void *)&ptrs[1])
805f60a
  							 == ITEM_COMPARE_FAIL)
805f60a
! 	    EMSG(_("E702: Sort compare function failed"));
805f60a
  	else
805f60a
  	{
805f60a
! 	    /* Sort the array with item pointers. */
805f60a
! 	    qsort((void *)ptrs, (size_t)len, sizeof(listitem_T *),
805f60a
! 		    item_compare_func == NULL ? item_compare : item_compare2);
805f60a
  
805f60a
  	    if (!item_compare_func_err)
805f60a
  	    {
805f60a
! 		/* Clear the List and append the items in the sorted order. */
805f60a
! 		l->lv_first = l->lv_last = l->lv_idx_item = NULL;
805f60a
! 		l->lv_len = 0;
805f60a
! 		for (i = 0; i < len; ++i)
805f60a
! 		    list_append(l, ptrs[i]);
805f60a
  	    }
805f60a
  	}
805f60a
  
805f60a
--- 17167,17238 ----
805f60a
  	ptrs = (listitem_T **)alloc((int)(len * sizeof(listitem_T *)));
805f60a
  	if (ptrs == NULL)
805f60a
  	    return;
805f60a
  
805f60a
! 	i = 0;
805f60a
! 	if (sort)
805f60a
! 	{
805f60a
! 	    /* sort(): ptrs will be the list to sort */
805f60a
! 	    for (li = l->lv_first; li != NULL; li = li->li_next)
805f60a
! 		ptrs[i++] = li;
805f60a
! 
805f60a
! 	    item_compare_func_err = FALSE;
805f60a
! 	    /* test the compare function */
805f60a
! 	    if (item_compare_func != NULL
805f60a
! 		    && item_compare2((void *)&ptrs[0], (void *)&ptrs[1])
805f60a
  							 == ITEM_COMPARE_FAIL)
805f60a
! 		EMSG(_("E702: Sort compare function failed"));
805f60a
! 	    else
805f60a
! 	    {
805f60a
! 		/* Sort the array with item pointers. */
805f60a
! 		qsort((void *)ptrs, (size_t)len, sizeof(listitem_T *),
805f60a
! 		    item_compare_func == NULL ? item_compare : item_compare2);
805f60a
! 
805f60a
! 		if (!item_compare_func_err)
805f60a
! 		{
805f60a
! 		    /* Clear the List and append the items in sorted order. */
805f60a
! 		    l->lv_first = l->lv_last = l->lv_idx_item = NULL;
805f60a
! 		    l->lv_len = 0;
805f60a
! 		    for (i = 0; i < len; ++i)
805f60a
! 			list_append(l, ptrs[i]);
805f60a
! 		}
805f60a
! 	    }
805f60a
! 	}
805f60a
  	else
805f60a
  	{
805f60a
! 	    int	(*item_compare_func_ptr)__ARGS((const void *, const void *));
805f60a
! 
805f60a
! 	    /* f_uniq(): ptrs will be a stack of items to remove */
805f60a
! 	    item_compare_func_err = FALSE;
805f60a
! 	    item_compare_func_ptr = item_compare_func
805f60a
! 					       ? item_compare2 : item_compare;
805f60a
! 
805f60a
! 	    for (li = l->lv_first; li != NULL && li->li_next != NULL;
805f60a
! 							     li = li->li_next)
805f60a
! 	    {
805f60a
! 		if (item_compare_func_ptr((void *)&li, (void *)&li->li_next)
805f60a
! 									 == 0)
805f60a
! 		    ptrs[i++] = li;
805f60a
! 		if (item_compare_func_err)
805f60a
! 		{
805f60a
! 		    EMSG(_("E882: Uniq compare function failed"));
805f60a
! 		    break;
805f60a
! 		}
805f60a
! 	    }
805f60a
  
805f60a
  	    if (!item_compare_func_err)
805f60a
  	    {
805f60a
! 		while (--i >= 0)
805f60a
! 		{
805f60a
! 		    li = ptrs[i]->li_next;
805f60a
! 		    ptrs[i]->li_next = li->li_next;
805f60a
! 		    if (li->li_next != NULL)
805f60a
! 			li->li_next->li_prev = ptrs[i];
805f60a
! 		    else
805f60a
! 			l->lv_last = ptrs[i];
805f60a
! 		    list_fix_watch(l, li);
805f60a
! 		    listitem_free(li);
805f60a
! 		    l->lv_len--;
805f60a
! 		}
805f60a
  	    }
805f60a
  	}
805f60a
  
805f60a
***************
805f60a
*** 17194,17199 ****
805f60a
--- 17241,17268 ----
805f60a
  }
805f60a
  
805f60a
  /*
805f60a
+  * "sort({list})" function
805f60a
+  */
805f60a
+     static void
805f60a
+ f_sort(argvars, rettv)
805f60a
+     typval_T	*argvars;
805f60a
+     typval_T	*rettv;
805f60a
+ {
805f60a
+     do_sort_uniq(argvars, rettv, TRUE);
805f60a
+ }
805f60a
+ 
805f60a
+ /*
805f60a
+  * "uniq({list})" function
805f60a
+  */
805f60a
+     static void
805f60a
+ f_uniq(argvars, rettv)
805f60a
+     typval_T	*argvars;
805f60a
+     typval_T	*rettv;
805f60a
+ {
805f60a
+     do_sort_uniq(argvars, rettv, FALSE);
805f60a
+ }
805f60a
+ 
805f60a
+ /*
805f60a
   * "soundfold({word})" function
805f60a
   */
805f60a
      static void
805f60a
*** ../vim-7.4.217/src/testdir/test55.in	2014-01-14 15:24:24.000000000 +0100
805f60a
--- src/testdir/test55.in	2014-03-25 17:32:29.522040841 +0100
805f60a
***************
805f60a
*** 323,335 ****
805f60a
  :  $put ='caught ' . v:exception
805f60a
  :endtry
805f60a
  :"
805f60a
! :" reverse() and sort()
805f60a
! :let l = ['-0', 'A11', 2, 'xaaa', 4, 'foo', 'foo6', [0, 1, 2], 'x8']
805f60a
  :$put =string(reverse(l))
805f60a
  :$put =string(reverse(reverse(l)))
805f60a
  :$put =string(sort(l))
805f60a
  :$put =string(reverse(sort(l)))
805f60a
  :$put =string(sort(reverse(sort(l))))
805f60a
  :"
805f60a
  :" splitting a string to a List
805f60a
  :$put =string(split('  aa  bb '))
805f60a
--- 323,337 ----
805f60a
  :  $put ='caught ' . v:exception
805f60a
  :endtry
805f60a
  :"
805f60a
! :" reverse(), sort(), uniq()
805f60a
! :let l = ['-0', 'A11', 2, 2, 'xaaa', 4, 'foo', 'foo6', 'foo', [0, 1, 2], 'x8', [0, 1, 2], 1.5]
805f60a
! :$put =string(uniq(copy(l)))
805f60a
  :$put =string(reverse(l))
805f60a
  :$put =string(reverse(reverse(l)))
805f60a
  :$put =string(sort(l))
805f60a
  :$put =string(reverse(sort(l)))
805f60a
  :$put =string(sort(reverse(sort(l))))
805f60a
+ :$put =string(uniq(sort(l)))
805f60a
  :"
805f60a
  :" splitting a string to a List
805f60a
  :$put =string(split('  aa  bb '))
805f60a
*** ../vim-7.4.217/src/testdir/test55.ok	2014-01-14 15:24:24.000000000 +0100
805f60a
--- src/testdir/test55.ok	2014-03-25 17:32:29.522040841 +0100
805f60a
***************
805f60a
*** 94,104 ****
805f60a
  caught a:000[2]
805f60a
  caught a:000[3]
805f60a
  [1, 2, [3, 9, 5, 6], {'a': 12, '5': 8}]
805f60a
! ['x8', [0, 1, 2], 'foo6', 'foo', 4, 'xaaa', 2, 'A11', '-0']
805f60a
! ['x8', [0, 1, 2], 'foo6', 'foo', 4, 'xaaa', 2, 'A11', '-0']
805f60a
! ['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 2, 4, [0, 1, 2]]
805f60a
! [[0, 1, 2], 4, 2, 'xaaa', 'x8', 'foo6', 'foo', 'A11', '-0']
805f60a
! ['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 2, 4, [0, 1, 2]]
805f60a
  ['aa', 'bb']
805f60a
  ['aa', 'bb']
805f60a
  ['', 'aa', 'bb', '']
805f60a
--- 94,106 ----
805f60a
  caught a:000[2]
805f60a
  caught a:000[3]
805f60a
  [1, 2, [3, 9, 5, 6], {'a': 12, '5': 8}]
805f60a
! ['-0', 'A11', 2, 'xaaa', 4, 'foo', 'foo6', 'foo', [0, 1, 2], 'x8', [0, 1, 2], 1.5]
805f60a
! [1.5, [0, 1, 2], 'x8', [0, 1, 2], 'foo', 'foo6', 'foo', 4, 'xaaa', 2, 2, 'A11', '-0']
805f60a
! [1.5, [0, 1, 2], 'x8', [0, 1, 2], 'foo', 'foo6', 'foo', 4, 'xaaa', 2, 2, 'A11', '-0']
805f60a
! ['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]]
805f60a
! [[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0']
805f60a
! ['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]]
805f60a
! ['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]]
805f60a
  ['aa', 'bb']
805f60a
  ['aa', 'bb']
805f60a
  ['', 'aa', 'bb', '']
805f60a
*** ../vim-7.4.217/src/version.c	2014-03-25 18:05:45.242071421 +0100
805f60a
--- src/version.c	2014-03-25 17:34:51.918043023 +0100
805f60a
***************
805f60a
*** 736,737 ****
805f60a
--- 736,739 ----
805f60a
  {   /* Add new patch number below this line */
805f60a
+ /**/
805f60a
+     218,
805f60a
  /**/
805f60a
805f60a
-- 
805f60a
Never under any circumstances take a sleeping pill
805f60a
and a laxative on the same night.
805f60a
805f60a
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
805f60a
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
805f60a
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
805f60a
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///