summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.152
blob: 6e54ddb9c535ac799bf52efe6aefd58afdd666b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
To: vim_dev@googlegroups.com
Subject: Patch 7.4.152
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.152
Problem:    Python: Cannot iterate over options.
Solution:   Add options iterator. (ZyX)
Files:	    src/if_py_both.h, src/option.c, src/proto/option.pro,
	    src/testdir/test86.in, src/testdir/test86.ok,
	    src/testdir/test87.in, src/testdir/test87.ok, src/vim.h


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

-- 
hundred-and-one symptoms of being an internet addict:
160. You get in the elevator and double-click the button for the floor
     you want.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///