mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
updated for version 7.3.881
Problem: Python list does not work correctly. Solution: Fix it and add a test. (Yukihiro Nakadaira)
This commit is contained in:
@@ -1139,7 +1139,7 @@ ListSlice(PyObject *self, Py_ssize_t first, Py_ssize_t last)
|
|||||||
|
|
||||||
for (i = 0; i < n; ++i)
|
for (i = 0; i < n; ++i)
|
||||||
{
|
{
|
||||||
PyObject *item = ListItem(self, i);
|
PyObject *item = ListItem(self, first + i);
|
||||||
if (item == NULL)
|
if (item == NULL)
|
||||||
{
|
{
|
||||||
Py_DECREF(list);
|
Py_DECREF(list);
|
||||||
|
@@ -321,6 +321,31 @@ EOF
|
|||||||
:py trace_main()
|
:py trace_main()
|
||||||
:py sys.settrace(None)
|
:py sys.settrace(None)
|
||||||
:$put =string(l)
|
:$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
|
:endfun
|
||||||
:"
|
:"
|
||||||
:call Test()
|
:call Test()
|
||||||
|
@@ -65,3 +65,14 @@ undefined_name: Vim(let):Trace
|
|||||||
vim: Vim(let):E859:
|
vim: Vim(let):E859:
|
||||||
[1]
|
[1]
|
||||||
[1, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 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]
|
||||||
|
@@ -728,6 +728,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
881,
|
||||||
/**/
|
/**/
|
||||||
880,
|
880,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user