]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.881 v7.3.881
authorBram Moolenaar <Bram@vim.org>
Fri, 5 Apr 2013 17:32:36 +0000 (19:32 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 5 Apr 2013 17:32:36 +0000 (19:32 +0200)
Problem:    Python list does not work correctly.
Solution:   Fix it and add a test. (Yukihiro Nakadaira)

src/if_py_both.h
src/testdir/test86.in
src/testdir/test86.ok
src/version.c

index 1d999095e4147c2d8e40191fcbdba1c3f37ad161..f5617acfcfd14fe77f8ca23b36a43ae103ad88a2 100644 (file)
@@ -1139,7 +1139,7 @@ ListSlice(PyObject *self, Py_ssize_t first, Py_ssize_t last)
 
     for (i = 0; i < n; ++i)
     {
-       PyObject        *item = ListItem(self, i);
+       PyObject        *item = ListItem(self, first + i);
        if (item == NULL)
        {
            Py_DECREF(list);
index 5282269a3a7c97478c474607a5991fd34a0b3355..b53b6bf391aff49af65da21535de56f170c7ecbe 100644 (file)
@@ -321,6 +321,31 @@ EOF
 :py trace_main()
 :py sys.settrace(None)
 :$put =string(l)
+:"
+:" Slice
+:py ll = vim.bindeval('[0, 1, 2, 3, 4, 5]')
+:py l = ll[:4]
+:$put =string(pyeval('l'))
+:py l = ll[2:]
+:$put =string(pyeval('l'))
+:py l = ll[:-4]
+:$put =string(pyeval('l'))
+:py l = ll[-2:]
+:$put =string(pyeval('l'))
+:py l = ll[2:4]
+:$put =string(pyeval('l'))
+:py l = ll[4:2]
+:$put =string(pyeval('l'))
+:py l = ll[-4:-2]
+:$put =string(pyeval('l'))
+:py l = ll[-2:-4]
+:$put =string(pyeval('l'))
+:py l = ll[:]
+:$put =string(pyeval('l'))
+:py l = ll[0:6]
+:$put =string(pyeval('l'))
+:py l = ll[-10:10]
+:$put =string(pyeval('l'))
 :endfun
 :"
 :call Test()
index 8960390f593b60680c5ec2a2666e8b5e02b94197..fd670c8463d7b20d67eb0bede418cf456e5406b4 100644 (file)
@@ -65,3 +65,14 @@ undefined_name:      Vim(let):Trace
 vim:   Vim(let):E859:
 [1]
 [1, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 1]
+[0, 1, 2, 3]
+[2, 3, 4, 5]
+[0, 1]
+[4, 5]
+[2, 3]
+[]
+[2, 3]
+[]
+[0, 1, 2, 3, 4, 5]
+[0, 1, 2, 3, 4, 5]
+[0, 1, 2, 3, 4, 5]
index 78dc1d0020f72fff00cf6cebd72177fd8e19fd6a..4d056c640d803181109a5c88b2ab356b1a2b7764 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    881,
 /**/
     880,
 /**/