summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2013-05-12 19:30:31 +0200
committerBram Moolenaar <bram@vim.org>2013-05-12 19:30:31 +0200
commit35bceeab7d2d809f377274cdaa889970eb6c9d69 (patch)
tree30fc5b7e2ac91a1a4ee89584e27121044391dd28
parent51da52c9bcd9ab1bc2ed3d70efb3a1f67d7aeabb (diff)
downloadvim-35bceeab7d2d809f377274cdaa889970eb6c9d69.tar.gz
updated for version 7.3.940v7.3.940v7-3-940
Problem: Python: Can't get position of window. Solution: Add window.row and window.col. (ZyX)
-rw-r--r--runtime/doc/if_pyth.txt3
-rw-r--r--src/if_py_both.h10
-rw-r--r--src/version.c2
3 files changed, 13 insertions, 2 deletions
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt
index bf21f8cc..dcdcf207 100644
--- a/runtime/doc/if_pyth.txt
+++ b/runtime/doc/if_pyth.txt
@@ -400,6 +400,9 @@ Window attributes are:
This is zero in case it cannot be determined
(e.g. when the window object belongs to other
tab page).
+ row, col (read-only) On-screen window position in display cells.
+ First position is zero.
+
The height attribute is writable only if the screen is split horizontally.
The width attribute is writable only if the screen is split vertically.
diff --git a/src/if_py_both.h b/src/if_py_both.h
index dc9be3ad..f20f3ff5 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -1839,9 +1839,15 @@ WindowAttr(WindowObject *this, char *name)
}
else if (strcmp(name, "height") == 0)
return PyLong_FromLong((long)(this->win->w_height));
+#ifdef FEAT_WINDOWS
+ else if (strcmp(name, "row") == 0)
+ return PyLong_FromLong((long)(this->win->w_winrow));
+#endif
#ifdef FEAT_VERTSPLIT
else if (strcmp(name, "width") == 0)
return PyLong_FromLong((long)(W_WIDTH(this->win)));
+ else if (strcmp(name, "col") == 0)
+ return PyLong_FromLong((long)(W_WINCOL(this->win)));
#endif
else if (strcmp(name, "vars") == 0)
return DictionaryNew(this->win->w_vars);
@@ -1851,8 +1857,8 @@ WindowAttr(WindowObject *this, char *name)
else if (strcmp(name, "number") == 0)
return PyLong_FromLong((long) get_win_number(this->win));
else if (strcmp(name,"__members__") == 0)
- return Py_BuildValue("[ssssss]", "buffer", "cursor", "height", "vars",
- "options", "number");
+ return Py_BuildValue("[ssssssss]", "buffer", "cursor", "height", "vars",
+ "options", "number", "row", "col");
else
return NULL;
}
diff --git a/src/version.c b/src/version.c
index 8e311b86..20239c29 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 940,
+/**/
939,
/**/
938,