0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.3.949

Problem:    Python: no easy access to tabpages.
Solution:   Add vim.tabpages and vim.current.tabpage. (ZyX)
This commit is contained in:
Bram Moolenaar
2013-05-15 15:12:29 +02:00
parent 03db85b398
commit 5e538ecd5e
10 changed files with 426 additions and 13 deletions

View File

@@ -3510,6 +3510,15 @@ free_tabpage(tp)
hash_init(&tp->tp_vars->dv_hashtab);
unref_var_dict(tp->tp_vars);
#endif
#ifdef FEAT_PYTHON
python_tabpage_free(tp);
#endif
#ifdef FEAT_PYTHON3
python3_tabpage_free(tp);
#endif
vim_free(tp);
}
@@ -6734,12 +6743,12 @@ get_match(wp, id)
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO)
int
get_win_number(win_T *wp)
get_win_number(win_T *wp, win_T *first_win)
{
int i = 1;
win_T *w;
for (w = firstwin; w != NULL && w != wp; w = W_NEXT(w))
for (w = first_win; w != NULL && w != wp; w = W_NEXT(w))
++i;
if (w == NULL)
@@ -6747,4 +6756,19 @@ get_win_number(win_T *wp)
else
return i;
}
int
get_tab_number(tabpage_T *tp)
{
int i = 1;
tabpage_T *t;
for (t = first_tabpage; t != NULL && t != tp; t = t->tp_next)
++i;
if (t == NULL)
return 0;
else
return i;
}
#endif