summaryrefslogtreecommitdiff
path: root/src/if_python3.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-05-15 13:38:47 +0200
committerBram Moolenaar <Bram@vim.org>2013-05-15 13:38:47 +0200
commitdfa38d4e45a4a64c6b2a84c1d4c91b153f43a86d (patch)
treea60f495de869a13fde8cdf7cabd2ad977f9da521 /src/if_python3.c
parent29607acff640183682cd4ecb6c65985a7897bd51 (diff)
downloadvim-git-dfa38d4e45a4a64c6b2a84c1d4c91b153f43a86d.tar.gz
updated for version 7.3.945v7.3.945
Problem: Python: List of buffers is not very useful. Solution: Make vim.buffers a map. No iterator yet. (ZyX)
Diffstat (limited to 'src/if_python3.c')
-rw-r--r--src/if_python3.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/if_python3.c b/src/if_python3.c
index daaf689b4..28820ae80 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -1272,22 +1272,6 @@ RangeAsSubscript(PyObject *self, PyObject *idx, PyObject *val)
}
}
-/* Buffer list object - Definitions
- */
-
-static PySequenceMethods BufListAsSeq = {
- (lenfunc) BufListLength, /* sq_length, len(x) */
- (binaryfunc) 0, /* sq_concat, x+y */
- (ssizeargfunc) 0, /* sq_repeat, x*n */
- (ssizeargfunc) BufListItem, /* sq_item, x[i] */
- 0, /* was_sq_slice, x[i:j] */
- (ssizeobjargproc) 0, /* sq_as_item, x[i]=v */
- 0, /* sq_ass_slice, x[i:j]=v */
- 0, /* sq_contains */
- 0, /* sq_inplace_concat */
- 0, /* sq_inplace_repeat */
-};
-
/* Window object - Implementation
*/
@@ -1512,9 +1496,9 @@ python3_window_free(win_T *win)
}
#endif
-static BufListObject TheBufferList =
+static BufMapObject TheBufferMap =
{
- PyObject_HEAD_INIT(&BufListType)
+ PyObject_HEAD_INIT(&BufMapType)
};
static WinListObject TheWindowList =
@@ -1538,7 +1522,7 @@ Py3Init_vim(void)
PyType_Ready(&BufferType);
PyType_Ready(&RangeType);
PyType_Ready(&WindowType);
- PyType_Ready(&BufListType);
+ PyType_Ready(&BufMapType);
PyType_Ready(&WinListType);
PyType_Ready(&CurrentType);
PyType_Ready(&DictionaryType);
@@ -1557,8 +1541,8 @@ Py3Init_vim(void)
Py_INCREF(VimError);
PyModule_AddObject(mod, "error", VimError);
- Py_INCREF((PyObject *)(void *)&TheBufferList);
- PyModule_AddObject(mod, "buffers", (PyObject *)(void *)&TheBufferList);
+ Py_INCREF((PyObject *)(void *)&TheBufferMap);
+ PyModule_AddObject(mod, "buffers", (PyObject *)(void *)&TheBufferMap);
Py_INCREF((PyObject *)(void *)&TheCurrent);
PyModule_AddObject(mod, "current", (PyObject *)(void *)&TheCurrent);
Py_INCREF((PyObject *)(void *)&TheWindowList);