mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
updated for version 7.3.1044
Problem: Python: No {Buffer,TabPage,Window}.valid attributes. Solution: Python patch 5: add .valid (ZyX)
This commit is contained in:
@@ -1814,6 +1814,19 @@ TabPageDestructor(TabPageObject *self)
|
||||
DESTRUCTOR_FINISH(self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
TabPageAttrValid(TabPageObject *self, char *name)
|
||||
{
|
||||
PyObject *r;
|
||||
|
||||
if (strcmp(name, "valid") != 0)
|
||||
return NULL;
|
||||
|
||||
r = ((self->tab == INVALID_TABPAGE_VALUE) ? Py_False : Py_True);
|
||||
Py_INCREF(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
TabPageAttr(TabPageObject *self, char *name)
|
||||
{
|
||||
@@ -2009,6 +2022,19 @@ get_firstwin(TabPageObject *tabObject)
|
||||
return firstwin;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
WindowAttrValid(WindowObject *self, char *name)
|
||||
{
|
||||
PyObject *r;
|
||||
|
||||
if (strcmp(name, "valid") != 0)
|
||||
return NULL;
|
||||
|
||||
r = ((self->win == INVALID_WINDOW_VALUE) ? Py_False : Py_True);
|
||||
Py_INCREF(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
WindowAttr(WindowObject *self, char *name)
|
||||
{
|
||||
@@ -2050,8 +2076,8 @@ WindowAttr(WindowObject *self, char *name)
|
||||
return (PyObject *)(self->tabObject);
|
||||
}
|
||||
else if (strcmp(name,"__members__") == 0)
|
||||
return Py_BuildValue("[sssssssss]", "buffer", "cursor", "height",
|
||||
"vars", "options", "number", "row", "col", "tabpage");
|
||||
return Py_BuildValue("[ssssssssss]", "buffer", "cursor", "height",
|
||||
"vars", "options", "number", "row", "col", "tabpage", "valid");
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
@@ -3185,6 +3211,19 @@ BufferSlice(BufferObject *self, PyInt lo, PyInt hi)
|
||||
return RBSlice(self, lo, hi, 1, -1);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
BufferAttrValid(BufferObject *self, char *name)
|
||||
{
|
||||
PyObject *r;
|
||||
|
||||
if (strcmp(name, "valid") != 0)
|
||||
return NULL;
|
||||
|
||||
r = ((self->buf == INVALID_BUFFER_VALUE) ? Py_False : Py_True);
|
||||
Py_INCREF(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
BufferAttr(BufferObject *self, char *name)
|
||||
{
|
||||
@@ -3198,7 +3237,8 @@ BufferAttr(BufferObject *self, char *name)
|
||||
return OptionsNew(SREQ_BUF, self->buf, (checkfun) CheckBuffer,
|
||||
(PyObject *) self);
|
||||
else if (strcmp(name,"__members__") == 0)
|
||||
return Py_BuildValue("[ssss]", "name", "number", "vars", "options");
|
||||
return Py_BuildValue("[sssss]", "name", "number", "vars", "options",
|
||||
"valid");
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user