diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-05-15 15:12:29 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-05-15 15:12:29 +0200 |
commit | 5e538ecd5e68b90f630be7bb177ab64e1285e40b (patch) | |
tree | a2de7e503d39d22f9edb40253bb8cfb15d6f9a8e /src/window.c | |
parent | 03db85b398746a252345ed8a7da69f0f2591e932 (diff) | |
download | vim-git-5e538ecd5e68b90f630be7bb177ab64e1285e40b.tar.gz |
updated for version 7.3.949v7.3.949
Problem: Python: no easy access to tabpages.
Solution: Add vim.tabpages and vim.current.tabpage. (ZyX)
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c index 035471490..bbd8d1e51 100644 --- a/src/window.c +++ b/src/window.c @@ -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 |