Mercurial > vim
comparison src/if_py_both.h @ 4383:e2db42528a5b v7.3.940
updated for version 7.3.940
Problem: Python: Can't get position of window.
Solution: Add window.row and window.col. (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 12 May 2013 19:30:31 +0200 |
parents | 48a22f36ff45 |
children | da71e66dc1d4 |
comparison
equal
deleted
inserted
replaced
4382:977fbe80d49f | 4383:e2db42528a5b |
---|---|
1837 | 1837 |
1838 return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col)); | 1838 return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col)); |
1839 } | 1839 } |
1840 else if (strcmp(name, "height") == 0) | 1840 else if (strcmp(name, "height") == 0) |
1841 return PyLong_FromLong((long)(this->win->w_height)); | 1841 return PyLong_FromLong((long)(this->win->w_height)); |
1842 #ifdef FEAT_WINDOWS | |
1843 else if (strcmp(name, "row") == 0) | |
1844 return PyLong_FromLong((long)(this->win->w_winrow)); | |
1845 #endif | |
1842 #ifdef FEAT_VERTSPLIT | 1846 #ifdef FEAT_VERTSPLIT |
1843 else if (strcmp(name, "width") == 0) | 1847 else if (strcmp(name, "width") == 0) |
1844 return PyLong_FromLong((long)(W_WIDTH(this->win))); | 1848 return PyLong_FromLong((long)(W_WIDTH(this->win))); |
1849 else if (strcmp(name, "col") == 0) | |
1850 return PyLong_FromLong((long)(W_WINCOL(this->win))); | |
1845 #endif | 1851 #endif |
1846 else if (strcmp(name, "vars") == 0) | 1852 else if (strcmp(name, "vars") == 0) |
1847 return DictionaryNew(this->win->w_vars); | 1853 return DictionaryNew(this->win->w_vars); |
1848 else if (strcmp(name, "options") == 0) | 1854 else if (strcmp(name, "options") == 0) |
1849 return OptionsNew(SREQ_WIN, this->win, (checkfun) CheckWindow, | 1855 return OptionsNew(SREQ_WIN, this->win, (checkfun) CheckWindow, |
1850 (PyObject *) this); | 1856 (PyObject *) this); |
1851 else if (strcmp(name, "number") == 0) | 1857 else if (strcmp(name, "number") == 0) |
1852 return PyLong_FromLong((long) get_win_number(this->win)); | 1858 return PyLong_FromLong((long) get_win_number(this->win)); |
1853 else if (strcmp(name,"__members__") == 0) | 1859 else if (strcmp(name,"__members__") == 0) |
1854 return Py_BuildValue("[ssssss]", "buffer", "cursor", "height", "vars", | 1860 return Py_BuildValue("[ssssssss]", "buffer", "cursor", "height", "vars", |
1855 "options", "number"); | 1861 "options", "number", "row", "col"); |
1856 else | 1862 else |
1857 return NULL; | 1863 return NULL; |
1858 } | 1864 } |
1859 | 1865 |
1860 static void | 1866 static void |