mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.3.938
Problem: Python: not easy to get to window number. Solution: Add vim.window.number. (ZyX)
This commit is contained in:
17
src/window.c
17
src/window.c
@@ -6731,3 +6731,20 @@ get_match(wp, id)
|
||||
return cur;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO)
|
||||
int
|
||||
get_win_number(win_T *wp)
|
||||
{
|
||||
int i = 1;
|
||||
win_T *w;
|
||||
|
||||
for (w = firstwin; w != NULL && w != wp; w = W_NEXT(w))
|
||||
++i;
|
||||
|
||||
if (w == NULL)
|
||||
return 0;
|
||||
else
|
||||
return i;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user