astepano / rpms / vim

Forked from rpms/vim 6 years ago
Clone
acc3702
To: vim_dev@googlegroups.com
acc3702
Subject: Patch 7.4.152
acc3702
Fcc: outbox
acc3702
From: Bram Moolenaar <Bram@moolenaar.net>
acc3702
Mime-Version: 1.0
acc3702
Content-Type: text/plain; charset=UTF-8
acc3702
Content-Transfer-Encoding: 8bit
acc3702
------------
acc3702
acc3702
Patch 7.4.152
acc3702
Problem:    Python: Cannot iterate over options.
acc3702
Solution:   Add options iterator. (ZyX)
acc3702
Files:	    src/if_py_both.h, src/option.c, src/proto/option.pro,
acc3702
	    src/testdir/test86.in, src/testdir/test86.ok,
acc3702
	    src/testdir/test87.in, src/testdir/test87.ok, src/vim.h
acc3702
acc3702
acc3702
*** ../vim-7.4.151/src/if_py_both.h	2014-01-14 16:36:40.000000000 +0100
acc3702
--- src/if_py_both.h	2014-01-14 16:51:30.000000000 +0100
acc3702
***************
acc3702
*** 2949,2958 ****
acc3702
  typedef struct
acc3702
  {
acc3702
      PyObject_HEAD
acc3702
!     int opt_type;
acc3702
!     void *from;
acc3702
!     checkfun Check;
acc3702
!     PyObject *fromObj;
acc3702
  } OptionsObject;
acc3702
  
acc3702
      static int
acc3702
--- 2949,2958 ----
acc3702
  typedef struct
acc3702
  {
acc3702
      PyObject_HEAD
acc3702
!     int		opt_type;
acc3702
!     void	*from;
acc3702
!     checkfun	Check;
acc3702
!     PyObject	*fromObj;
acc3702
  } OptionsObject;
acc3702
  
acc3702
      static int
acc3702
***************
acc3702
*** 3072,3077 ****
acc3702
--- 3072,3140 ----
acc3702
  }
acc3702
  
acc3702
      static int
acc3702
+ OptionsContains(OptionsObject *self, PyObject *keyObject)
acc3702
+ {
acc3702
+     char_u	*key;
acc3702
+     PyObject	*todecref;
acc3702
+ 
acc3702
+     if (!(key = StringToChars(keyObject, &todecref)))
acc3702
+ 	return -1;
acc3702
+ 
acc3702
+     if (*key == NUL)
acc3702
+     {
acc3702
+ 	Py_XDECREF(todecref);
acc3702
+ 	return 0;
acc3702
+     }
acc3702
+ 
acc3702
+     if (get_option_value_strict(key, NULL, NULL, self->opt_type, NULL))
acc3702
+     {
acc3702
+ 	Py_XDECREF(todecref);
acc3702
+ 	return 1;
acc3702
+     }
acc3702
+     else
acc3702
+     {
acc3702
+ 	Py_XDECREF(todecref);
acc3702
+ 	return 0;
acc3702
+     }
acc3702
+ }
acc3702
+ 
acc3702
+ typedef struct
acc3702
+ {
acc3702
+     void	*lastoption;
acc3702
+     int		opt_type;
acc3702
+ } optiterinfo_T;
acc3702
+ 
acc3702
+     static PyObject *
acc3702
+ OptionsIterNext(optiterinfo_T **oii)
acc3702
+ {
acc3702
+     char_u	*name;
acc3702
+ 
acc3702
+     if ((name = option_iter_next(&((*oii)->lastoption), (*oii)->opt_type)))
acc3702
+ 	return PyString_FromString((char *)name);
acc3702
+ 
acc3702
+     return NULL;
acc3702
+ }
acc3702
+ 
acc3702
+     static PyObject *
acc3702
+ OptionsIter(OptionsObject *self)
acc3702
+ {
acc3702
+     optiterinfo_T	*oii;
acc3702
+ 
acc3702
+     if (!(oii = PyMem_New(optiterinfo_T, 1)))
acc3702
+     {
acc3702
+ 	PyErr_NoMemory();
acc3702
+ 	return NULL;
acc3702
+     }
acc3702
+ 
acc3702
+     oii->opt_type = self->opt_type;
acc3702
+     oii->lastoption = NULL;
acc3702
+ 
acc3702
+     return IterNew(oii,
acc3702
+ 	    (destructorfun) PyMem_Free, (nextfun) OptionsIterNext,
acc3702
+ 	    NULL, NULL);
acc3702
+ }
acc3702
+ 
acc3702
+     static int
acc3702
  set_option_value_err(char_u *key, int numval, char_u *stringval, int opt_flags)
acc3702
  {
acc3702
      char_u	*errmsg;
acc3702
***************
acc3702
*** 3231,3236 ****
acc3702
--- 3294,3312 ----
acc3702
      return ret;
acc3702
  }
acc3702
  
acc3702
+ static PySequenceMethods OptionsAsSeq = {
acc3702
+     0,					/* sq_length */
acc3702
+     0,					/* sq_concat */
acc3702
+     0,					/* sq_repeat */
acc3702
+     0,					/* sq_item */
acc3702
+     0,					/* sq_slice */
acc3702
+     0,					/* sq_ass_item */
acc3702
+     0,					/* sq_ass_slice */
acc3702
+     (objobjproc) OptionsContains,	/* sq_contains */
acc3702
+     0,					/* sq_inplace_concat */
acc3702
+     0,					/* sq_inplace_repeat */
acc3702
+ };
acc3702
+ 
acc3702
  static PyMappingMethods OptionsAsMapping = {
acc3702
      (lenfunc)       NULL,
acc3702
      (binaryfunc)    OptionsItem,
acc3702
***************
acc3702
*** 6121,6128 ****
acc3702
--- 6197,6206 ----
acc3702
      vim_memset(&OptionsType, 0, sizeof(OptionsType));
acc3702
      OptionsType.tp_name = "vim.options";
acc3702
      OptionsType.tp_basicsize = sizeof(OptionsObject);
acc3702
+     OptionsType.tp_as_sequence = &OptionsAsSeq;
acc3702
      OptionsType.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC;
acc3702
      OptionsType.tp_doc = "object for manipulating options";
acc3702
+     OptionsType.tp_iter = (getiterfunc)OptionsIter;
acc3702
      OptionsType.tp_as_mapping = &OptionsAsMapping;
acc3702
      OptionsType.tp_dealloc = (destructor)OptionsDestructor;
acc3702
      OptionsType.tp_traverse = (traverseproc)OptionsTraverse;
acc3702
*** ../vim-7.4.151/src/option.c	2013-11-12 04:43:57.000000000 +0100
acc3702
--- src/option.c	2014-01-14 16:50:52.000000000 +0100
acc3702
***************
acc3702
*** 8861,8867 ****
acc3702
  }
acc3702
  #endif
acc3702
  
acc3702
! #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
acc3702
  /*
acc3702
   * Returns the option attributes and its value. Unlike the above function it
acc3702
   * will return either global value or local value of the option depending on
acc3702
--- 8861,8867 ----
acc3702
  }
acc3702
  #endif
acc3702
  
acc3702
! #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO)
acc3702
  /*
acc3702
   * Returns the option attributes and its value. Unlike the above function it
acc3702
   * will return either global value or local value of the option depending on
acc3702
***************
acc3702
*** 8874,8880 ****
acc3702
   * opt_type). Uses
acc3702
   *
acc3702
   * Returned flags:
acc3702
!  *       0 hidden or unknown option
acc3702
   *  see SOPT_* in vim.h for other flags
acc3702
   *
acc3702
   * Possible opt_type values: see SREQ_* in vim.h
acc3702
--- 8874,8881 ----
acc3702
   * opt_type). Uses
acc3702
   *
acc3702
   * Returned flags:
acc3702
!  *       0 hidden or unknown option, also option that does not have requested 
acc3702
!  *         type (see SREQ_* in vim.h)
acc3702
   *  see SOPT_* in vim.h for other flags
acc3702
   *
acc3702
   * Possible opt_type values: see SREQ_* in vim.h
acc3702
***************
acc3702
*** 8997,9002 ****
acc3702
--- 8998,9065 ----
acc3702
  
acc3702
      return r;
acc3702
  }
acc3702
+ 
acc3702
+ /*
acc3702
+  * Iterate over options. First argument is a pointer to a pointer to a structure 
acc3702
+  * inside options[] array, second is option type like in the above function.
acc3702
+  *
acc3702
+  * If first argument points to NULL it is assumed that iteration just started 
acc3702
+  * and caller needs the very first value.
acc3702
+  * If first argument points to the end marker function returns NULL and sets 
acc3702
+  * first argument to NULL.
acc3702
+  *
acc3702
+  * Returns full option name for current option on each call.
acc3702
+  */
acc3702
+     char_u *
acc3702
+ option_iter_next(option, opt_type)
acc3702
+     void	**option;
acc3702
+     int		opt_type;
acc3702
+ {
acc3702
+     struct vimoption	*ret = NULL;
acc3702
+     do
acc3702
+     {
acc3702
+ 	if (*option == NULL)
acc3702
+ 	    *option = (void *) options;
acc3702
+ 	else if (((struct vimoption *) (*option))->fullname == NULL)
acc3702
+ 	{
acc3702
+ 	    *option = NULL;
acc3702
+ 	    return NULL;
acc3702
+ 	}
acc3702
+ 	else
acc3702
+ 	    *option = (void *) (((struct vimoption *) (*option)) + 1);
acc3702
+ 
acc3702
+ 	ret = ((struct vimoption *) (*option));
acc3702
+ 
acc3702
+ 	/* Hidden option */
acc3702
+ 	if (ret->var == NULL)
acc3702
+ 	{
acc3702
+ 	    ret = NULL;
acc3702
+ 	    continue;
acc3702
+ 	}
acc3702
+ 
acc3702
+ 	switch (opt_type)
acc3702
+ 	{
acc3702
+ 	    case SREQ_GLOBAL:
acc3702
+ 		if (!(ret->indir == PV_NONE || ret->indir & PV_BOTH))
acc3702
+ 		    ret = NULL;
acc3702
+ 		break;
acc3702
+ 	    case SREQ_BUF:
acc3702
+ 		if (!(ret->indir & PV_BUF))
acc3702
+ 		    ret = NULL;
acc3702
+ 		break;
acc3702
+ 	    case SREQ_WIN:
acc3702
+ 		if (!(ret->indir & PV_WIN))
acc3702
+ 		    ret = NULL;
acc3702
+ 		break;
acc3702
+ 	    default:
acc3702
+ 		EMSG2(_(e_intern2), "option_iter_next()");
acc3702
+ 		return NULL;
acc3702
+ 	}
acc3702
+     }
acc3702
+     while (ret == NULL);
acc3702
+ 
acc3702
+     return (char_u *)ret->fullname;
acc3702
+ }
acc3702
  #endif
acc3702
  
acc3702
  /*
acc3702
*** ../vim-7.4.151/src/proto/option.pro	2013-11-05 07:12:59.000000000 +0100
acc3702
--- src/proto/option.pro	2014-01-14 16:51:41.000000000 +0100
acc3702
***************
acc3702
*** 23,28 ****
acc3702
--- 23,29 ----
acc3702
  char_u *check_stl_option __ARGS((char_u *s));
acc3702
  int get_option_value __ARGS((char_u *name, long *numval, char_u **stringval, int opt_flags));
acc3702
  int get_option_value_strict __ARGS((char_u *name, long *numval, char_u **stringval, int opt_type, void *from));
acc3702
+ char_u *option_iter_next __ARGS((void **option, int opt_type));
acc3702
  char_u *set_option_value __ARGS((char_u *name, long number, char_u *string, int opt_flags));
acc3702
  char_u *get_term_code __ARGS((char_u *tname));
acc3702
  char_u *get_highlight_default __ARGS((void));
acc3702
*** ../vim-7.4.151/src/testdir/test86.in	2014-01-14 16:36:40.000000000 +0100
acc3702
--- src/testdir/test86.in	2014-01-14 16:49:10.000000000 +0100
acc3702
***************
acc3702
*** 506,511 ****
acc3702
--- 506,516 ----
acc3702
  :py bopts1=vim.buffers[vim.bindeval("g:bufs")[2]].options
acc3702
  :py bopts2=vim.buffers[vim.bindeval("g:bufs")[1]].options
acc3702
  :py bopts3=vim.buffers[vim.bindeval("g:bufs")[0]].options
acc3702
+ :$put ='wopts iters equal: '.pyeval('list(wopts1) == list(wopts2)')
acc3702
+ :$put ='bopts iters equal: '.pyeval('list(bopts1) == list(bopts2)')
acc3702
+ :py gset=set(iter(gopts1))
acc3702
+ :py wset=set(iter(wopts1))
acc3702
+ :py bset=set(iter(bopts1))
acc3702
  :set path=.,..,,
acc3702
  :let lst=[]
acc3702
  :let lst+=[['paste',          1,     0,     1,     2,      1,    1,      0    ]]
acc3702
***************
acc3702
*** 536,541 ****
acc3702
--- 541,548 ----
acc3702
  :       py oval3=bool(oval3)
acc3702
  :   endif
acc3702
  :   put ='>>> '.oname
acc3702
+ :   $put ='  g/w/b:'.pyeval('oname in gset').'/'.pyeval('oname in wset').'/'.pyeval('oname in bset')
acc3702
+ :   $put ='  g/w/b (in):'.pyeval('oname in gopts1').'/'.pyeval('oname in wopts1').'/'.pyeval('oname in bopts1')
acc3702
  :   for v in ['gopts1', 'wopts1', 'bopts1']
acc3702
  :       try
acc3702
  :           put ='  p/'.v.': '.Ev('repr('.v.'['''.oname.'''])')
acc3702
***************
acc3702
*** 1122,1127 ****
acc3702
--- 1129,1141 ----
acc3702
  ee('import failing')
acc3702
  vim.options['rtp'] = old_rtp
acc3702
  del old_rtp
acc3702
+ cb.append("> Options")
acc3702
+ cb.append(">> OptionsItem")
acc3702
+ ee('vim.options["abcQ"]')
acc3702
+ ee('vim.options[""]')
acc3702
+ stringtochars_test('vim.options[%s]')
acc3702
+ cb.append(">> OptionsContains")
acc3702
+ stringtochars_test('%s in vim.options')
acc3702
  cb.append("> Dictionary")
acc3702
  cb.append(">> DictionaryConstructor")
acc3702
  ee('vim.Dictionary("abcI")')
acc3702
*** ../vim-7.4.151/src/testdir/test86.ok	2014-01-14 16:36:40.000000000 +0100
acc3702
--- src/testdir/test86.ok	2014-01-14 16:49:10.000000000 +0100
acc3702
***************
acc3702
*** 112,118 ****
acc3702
--- 112,122 ----
acc3702
  def
acc3702
  bar
acc3702
  jkl
acc3702
+ wopts iters equal: 1
acc3702
+ bopts iters equal: 1
acc3702
  >>> paste
acc3702
+   g/w/b:1/0/0
acc3702
+   g/w/b (in):1/0/0
acc3702
    p/gopts1: False
acc3702
    p/wopts1! KeyError
acc3702
    inv: 2! KeyError
acc3702
***************
acc3702
*** 133,138 ****
acc3702
--- 137,144 ----
acc3702
    W: 1:1 2:1 3:1 4:1
acc3702
    B: 1:1 2:1 3:1 4:1
acc3702
  >>> previewheight
acc3702
+   g/w/b:1/0/0
acc3702
+   g/w/b (in):1/0/0
acc3702
    p/gopts1: 12
acc3702
    inv: 'a'! TypeError
acc3702
    p/wopts1! KeyError
acc3702
***************
acc3702
*** 154,159 ****
acc3702
--- 160,167 ----
acc3702
    W: 1:5 2:5 3:5 4:5
acc3702
    B: 1:5 2:5 3:5 4:5
acc3702
  >>> operatorfunc
acc3702
+   g/w/b:1/0/0
acc3702
+   g/w/b (in):1/0/0
acc3702
    p/gopts1: ''
acc3702
    inv: 2! TypeError
acc3702
    p/wopts1! KeyError
acc3702
***************
acc3702
*** 175,180 ****
acc3702
--- 183,190 ----
acc3702
    W: 1:'A' 2:'A' 3:'A' 4:'A'
acc3702
    B: 1:'A' 2:'A' 3:'A' 4:'A'
acc3702
  >>> number
acc3702
+   g/w/b:0/1/0
acc3702
+   g/w/b (in):0/1/0
acc3702
    p/gopts1! KeyError
acc3702
    inv: 0! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 193,198 ****
acc3702
--- 203,210 ----
acc3702
    W: 1:1 2:1 3:0 4:0
acc3702
    B: 1:1 2:1 3:0 4:0
acc3702
  >>> numberwidth
acc3702
+   g/w/b:0/1/0
acc3702
+   g/w/b (in):0/1/0
acc3702
    p/gopts1! KeyError
acc3702
    inv: -100! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 212,217 ****
acc3702
--- 224,231 ----
acc3702
    W: 1:3 2:5 3:2 4:8
acc3702
    B: 1:3 2:5 3:2 4:8
acc3702
  >>> colorcolumn
acc3702
+   g/w/b:0/1/0
acc3702
+   g/w/b (in):0/1/0
acc3702
    p/gopts1! KeyError
acc3702
    inv: 'abc4'! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 231,236 ****
acc3702
--- 245,252 ----
acc3702
    W: 1:'+2' 2:'+3' 3:'+1' 4:''
acc3702
    B: 1:'+2' 2:'+3' 3:'+1' 4:''
acc3702
  >>> statusline
acc3702
+   g/w/b:1/1/0
acc3702
+   g/w/b (in):1/1/0
acc3702
    p/gopts1: ''
acc3702
    inv: 0! TypeError
acc3702
    p/wopts1: None
acc3702
***************
acc3702
*** 248,253 ****
acc3702
--- 264,271 ----
acc3702
    W: 1:'2' 2:'1' 3:'1' 4:'1'
acc3702
    B: 1:'2' 2:'1' 3:'1' 4:'1'
acc3702
  >>> autoindent
acc3702
+   g/w/b:0/0/1
acc3702
+   g/w/b (in):0/0/1
acc3702
    p/gopts1! KeyError
acc3702
    inv: 2! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 266,271 ****
acc3702
--- 284,291 ----
acc3702
    W: 1:0 2:1 3:0 4:1
acc3702
    B: 1:0 2:1 3:0 4:1
acc3702
  >>> shiftwidth
acc3702
+   g/w/b:0/0/1
acc3702
+   g/w/b (in):0/0/1
acc3702
    p/gopts1! KeyError
acc3702
    inv: 3! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 284,289 ****
acc3702
--- 304,311 ----
acc3702
    W: 1:0 2:2 3:8 4:1
acc3702
    B: 1:0 2:2 3:8 4:1
acc3702
  >>> omnifunc
acc3702
+   g/w/b:0/0/1
acc3702
+   g/w/b (in):0/0/1
acc3702
    p/gopts1! KeyError
acc3702
    inv: 1! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 303,308 ****
acc3702
--- 325,332 ----
acc3702
    W: 1:'A' 2:'B' 3:'' 4:'C'
acc3702
    B: 1:'A' 2:'B' 3:'' 4:'C'
acc3702
  >>> preserveindent
acc3702
+   g/w/b:0/0/1
acc3702
+   g/w/b (in):0/0/1
acc3702
    p/gopts1! KeyError
acc3702
    inv: 2! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 321,326 ****
acc3702
--- 345,352 ----
acc3702
    W: 1:0 2:1 3:0 4:1
acc3702
    B: 1:0 2:1 3:0 4:1
acc3702
  >>> path
acc3702
+   g/w/b:1/0/1
acc3702
+   g/w/b (in):1/0/1
acc3702
    p/gopts1: '.,..,,'
acc3702
    inv: 0! TypeError
acc3702
    p/wopts1! KeyError
acc3702
***************
acc3702
*** 509,514 ****
acc3702
--- 535,555 ----
acc3702
  import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',)
acc3702
  import failing_import:ImportError:('No module named failing_import',)
acc3702
  import failing:NotImplementedError:()
acc3702
+ > Options
acc3702
+ >> OptionsItem
acc3702
+ vim.options["abcQ"]:KeyError:('abcQ',)
acc3702
+ vim.options[""]:ValueError:('empty keys are not allowed',)
acc3702
+ >>> Testing StringToChars using vim.options[%s]
acc3702
+ vim.options[1]:TypeError:('expected str() or unicode() instance, but got int',)
acc3702
+ vim.options[u"\0"]:TypeError:('expected string without null bytes',)
acc3702
+ vim.options["\0"]:TypeError:('expected string without null bytes',)
acc3702
+ <<< Finished
acc3702
+ >> OptionsContains
acc3702
+ >>> Testing StringToChars using %s in vim.options
acc3702
+ 1 in vim.options:TypeError:('expected str() or unicode() instance, but got int',)
acc3702
+ u"\0" in vim.options:TypeError:('expected string without null bytes',)
acc3702
+ "\0" in vim.options:TypeError:('expected string without null bytes',)
acc3702
+ <<< Finished
acc3702
  > Dictionary
acc3702
  >> DictionaryConstructor
acc3702
  vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',)
acc3702
*** ../vim-7.4.151/src/testdir/test87.in	2014-01-14 16:36:40.000000000 +0100
acc3702
--- src/testdir/test87.in	2014-01-14 16:49:10.000000000 +0100
acc3702
***************
acc3702
*** 503,508 ****
acc3702
--- 503,513 ----
acc3702
  :py3 bopts1=vim.buffers[vim.bindeval("g:bufs")[2]].options
acc3702
  :py3 bopts2=vim.buffers[vim.bindeval("g:bufs")[1]].options
acc3702
  :py3 bopts3=vim.buffers[vim.bindeval("g:bufs")[0]].options
acc3702
+ :$put ='wopts iters equal: '.py3eval('list(wopts1) == list(wopts2)')
acc3702
+ :$put ='bopts iters equal: '.py3eval('list(bopts1) == list(bopts2)')
acc3702
+ :py3 gset=set(iter(gopts1))
acc3702
+ :py3 wset=set(iter(wopts1))
acc3702
+ :py3 bset=set(iter(bopts1))
acc3702
  :set path=.,..,,
acc3702
  :let lst=[]
acc3702
  :let lst+=[['paste',          1,     0,     1,     2,      1,    1,      0    ]]
acc3702
***************
acc3702
*** 533,538 ****
acc3702
--- 538,545 ----
acc3702
  :       py3 oval3=bool(oval3)
acc3702
  :   endif
acc3702
  :   put ='>>> '.oname
acc3702
+ :   $put ='  g/w/b:'.py3eval('oname in gset').'/'.py3eval('oname in wset').'/'.py3eval('oname in bset')
acc3702
+ :   $put ='  g/w/b (in):'.py3eval('oname in gopts1').'/'.py3eval('oname in wopts1').'/'.py3eval('oname in bopts1')
acc3702
  :   for v in ['gopts1', 'wopts1', 'bopts1']
acc3702
  :       try
acc3702
  :           put ='  p/'.v.': '.Ev('repr('.v.'['''.oname.'''])')
acc3702
***************
acc3702
*** 1099,1104 ****
acc3702
--- 1106,1118 ----
acc3702
  ee('import failing')
acc3702
  vim.options['rtp'] = old_rtp
acc3702
  del old_rtp
acc3702
+ cb.append("> Options")
acc3702
+ cb.append(">> OptionsItem")
acc3702
+ ee('vim.options["abcQ"]')
acc3702
+ ee('vim.options[""]')
acc3702
+ stringtochars_test('vim.options[%s]')
acc3702
+ cb.append(">> OptionsContains")
acc3702
+ stringtochars_test('%s in vim.options')
acc3702
  cb.append("> Dictionary")
acc3702
  cb.append(">> DictionaryConstructor")
acc3702
  ee('vim.Dictionary("abcI")')
acc3702
*** ../vim-7.4.151/src/testdir/test87.ok	2014-01-14 16:36:40.000000000 +0100
acc3702
--- src/testdir/test87.ok	2014-01-14 16:49:10.000000000 +0100
acc3702
***************
acc3702
*** 112,118 ****
acc3702
--- 112,122 ----
acc3702
  def
acc3702
  bar
acc3702
  jkl
acc3702
+ wopts iters equal: 1
acc3702
+ bopts iters equal: 1
acc3702
  >>> paste
acc3702
+   g/w/b:1/0/0
acc3702
+   g/w/b (in):1/0/0
acc3702
    p/gopts1: False
acc3702
    p/wopts1! KeyError
acc3702
    inv: 2! KeyError
acc3702
***************
acc3702
*** 133,138 ****
acc3702
--- 137,144 ----
acc3702
    W: 1:1 2:1 3:1 4:1
acc3702
    B: 1:1 2:1 3:1 4:1
acc3702
  >>> previewheight
acc3702
+   g/w/b:1/0/0
acc3702
+   g/w/b (in):1/0/0
acc3702
    p/gopts1: 12
acc3702
    inv: 'a'! TypeError
acc3702
    p/wopts1! KeyError
acc3702
***************
acc3702
*** 154,159 ****
acc3702
--- 160,167 ----
acc3702
    W: 1:5 2:5 3:5 4:5
acc3702
    B: 1:5 2:5 3:5 4:5
acc3702
  >>> operatorfunc
acc3702
+   g/w/b:1/0/0
acc3702
+   g/w/b (in):1/0/0
acc3702
    p/gopts1: b''
acc3702
    inv: 2! TypeError
acc3702
    p/wopts1! KeyError
acc3702
***************
acc3702
*** 175,180 ****
acc3702
--- 183,190 ----
acc3702
    W: 1:'A' 2:'A' 3:'A' 4:'A'
acc3702
    B: 1:'A' 2:'A' 3:'A' 4:'A'
acc3702
  >>> number
acc3702
+   g/w/b:0/1/0
acc3702
+   g/w/b (in):0/1/0
acc3702
    p/gopts1! KeyError
acc3702
    inv: 0! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 193,198 ****
acc3702
--- 203,210 ----
acc3702
    W: 1:1 2:1 3:0 4:0
acc3702
    B: 1:1 2:1 3:0 4:0
acc3702
  >>> numberwidth
acc3702
+   g/w/b:0/1/0
acc3702
+   g/w/b (in):0/1/0
acc3702
    p/gopts1! KeyError
acc3702
    inv: -100! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 212,217 ****
acc3702
--- 224,231 ----
acc3702
    W: 1:3 2:5 3:2 4:8
acc3702
    B: 1:3 2:5 3:2 4:8
acc3702
  >>> colorcolumn
acc3702
+   g/w/b:0/1/0
acc3702
+   g/w/b (in):0/1/0
acc3702
    p/gopts1! KeyError
acc3702
    inv: 'abc4'! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 231,236 ****
acc3702
--- 245,252 ----
acc3702
    W: 1:'+2' 2:'+3' 3:'+1' 4:''
acc3702
    B: 1:'+2' 2:'+3' 3:'+1' 4:''
acc3702
  >>> statusline
acc3702
+   g/w/b:1/1/0
acc3702
+   g/w/b (in):1/1/0
acc3702
    p/gopts1: b''
acc3702
    inv: 0! TypeError
acc3702
    p/wopts1: None
acc3702
***************
acc3702
*** 248,253 ****
acc3702
--- 264,271 ----
acc3702
    W: 1:'2' 2:'1' 3:'1' 4:'1'
acc3702
    B: 1:'2' 2:'1' 3:'1' 4:'1'
acc3702
  >>> autoindent
acc3702
+   g/w/b:0/0/1
acc3702
+   g/w/b (in):0/0/1
acc3702
    p/gopts1! KeyError
acc3702
    inv: 2! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 266,271 ****
acc3702
--- 284,291 ----
acc3702
    W: 1:0 2:1 3:0 4:1
acc3702
    B: 1:0 2:1 3:0 4:1
acc3702
  >>> shiftwidth
acc3702
+   g/w/b:0/0/1
acc3702
+   g/w/b (in):0/0/1
acc3702
    p/gopts1! KeyError
acc3702
    inv: 3! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 284,289 ****
acc3702
--- 304,311 ----
acc3702
    W: 1:0 2:2 3:8 4:1
acc3702
    B: 1:0 2:2 3:8 4:1
acc3702
  >>> omnifunc
acc3702
+   g/w/b:0/0/1
acc3702
+   g/w/b (in):0/0/1
acc3702
    p/gopts1! KeyError
acc3702
    inv: 1! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 303,308 ****
acc3702
--- 325,332 ----
acc3702
    W: 1:'A' 2:'B' 3:'' 4:'C'
acc3702
    B: 1:'A' 2:'B' 3:'' 4:'C'
acc3702
  >>> preserveindent
acc3702
+   g/w/b:0/0/1
acc3702
+   g/w/b (in):0/0/1
acc3702
    p/gopts1! KeyError
acc3702
    inv: 2! KeyError
acc3702
    gopts1! KeyError
acc3702
***************
acc3702
*** 321,326 ****
acc3702
--- 345,352 ----
acc3702
    W: 1:0 2:1 3:0 4:1
acc3702
    B: 1:0 2:1 3:0 4:1
acc3702
  >>> path
acc3702
+   g/w/b:1/0/1
acc3702
+   g/w/b (in):1/0/1
acc3702
    p/gopts1: b'.,..,,'
acc3702
    inv: 0! TypeError
acc3702
    p/wopts1! KeyError
acc3702
***************
acc3702
*** 509,514 ****
acc3702
--- 535,555 ----
acc3702
  import xxx_no_such_module_xxx:(<class 'ImportError'>, ImportError('No module named xxx_no_such_module_xxx',))
acc3702
  import failing_import:(<class 'ImportError'>, ImportError('No module named failing_import',))
acc3702
  import failing:(<class 'NotImplementedError'>, NotImplementedError())
acc3702
+ > Options
acc3702
+ >> OptionsItem
acc3702
+ vim.options["abcQ"]:(<class 'KeyError'>, KeyError('abcQ',))
acc3702
+ vim.options[""]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
acc3702
+ >>> Testing StringToChars using vim.options[%s]
acc3702
+ vim.options[1]:(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
acc3702
+ vim.options[b"\0"]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
acc3702
+ vim.options["\0"]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
acc3702
+ <<< Finished
acc3702
+ >> OptionsContains
acc3702
+ >>> Testing StringToChars using %s in vim.options
acc3702
+ 1 in vim.options:(<class 'TypeError'>, TypeError('expected bytes() or str() instance, but got int',))
acc3702
+ b"\0" in vim.options:(<class 'TypeError'>, TypeError('expected bytes with no null',))
acc3702
+ "\0" in vim.options:(<class 'TypeError'>, TypeError('expected bytes with no null',))
acc3702
+ <<< Finished
acc3702
  > Dictionary
acc3702
  >> DictionaryConstructor
acc3702
  vim.Dictionary("abcI"):(<class 'ValueError'>, ValueError('expected sequence element of size 2, but got sequence of size 1',))
acc3702
*** ../vim-7.4.151/src/vim.h	2013-11-09 03:31:45.000000000 +0100
acc3702
--- src/vim.h	2014-01-14 16:49:10.000000000 +0100
acc3702
***************
acc3702
*** 2249,2254 ****
acc3702
--- 2249,2255 ----
acc3702
  #define SOPT_BUF	0x20	/* Option has buffer-local value */
acc3702
  #define SOPT_UNSET	0x40	/* Option does not have local value set */
acc3702
  
acc3702
+ /* Option types for various functions in option.c */
acc3702
  #define SREQ_GLOBAL	0	/* Request global option */
acc3702
  #define SREQ_WIN	1	/* Request window-local option */
acc3702
  #define SREQ_BUF	2	/* Request buffer-local option */
acc3702
*** ../vim-7.4.151/src/version.c	2014-01-14 16:36:40.000000000 +0100
acc3702
--- src/version.c	2014-01-14 16:43:58.000000000 +0100
acc3702
***************
acc3702
*** 740,741 ****
acc3702
--- 740,743 ----
acc3702
  {   /* Add new patch number below this line */
acc3702
+ /**/
acc3702
+     152,
acc3702
  /**/
acc3702
acc3702
-- 
acc3702
hundred-and-one symptoms of being an internet addict:
acc3702
160. You get in the elevator and double-click the button for the floor
acc3702
     you want.
acc3702
acc3702
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
acc3702
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
acc3702
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
acc3702
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///