Mercurial > vim
comparison src/window.c @ 4401:cfd76908da25 v7.3.949
updated for version 7.3.949
Problem: Python: no easy access to tabpages.
Solution: Add vim.tabpages and vim.current.tabpage. (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 15 May 2013 15:12:29 +0200 |
parents | a2f03b41dca7 |
children | e67522c4f566 |
comparison
equal
deleted
inserted
replaced
4400:7324bd8b67b1 | 4401:cfd76908da25 |
---|---|
3508 #ifdef FEAT_EVAL | 3508 #ifdef FEAT_EVAL |
3509 vars_clear(&tp->tp_vars->dv_hashtab); /* free all t: variables */ | 3509 vars_clear(&tp->tp_vars->dv_hashtab); /* free all t: variables */ |
3510 hash_init(&tp->tp_vars->dv_hashtab); | 3510 hash_init(&tp->tp_vars->dv_hashtab); |
3511 unref_var_dict(tp->tp_vars); | 3511 unref_var_dict(tp->tp_vars); |
3512 #endif | 3512 #endif |
3513 | |
3514 #ifdef FEAT_PYTHON | |
3515 python_tabpage_free(tp); | |
3516 #endif | |
3517 | |
3518 #ifdef FEAT_PYTHON3 | |
3519 python3_tabpage_free(tp); | |
3520 #endif | |
3521 | |
3513 vim_free(tp); | 3522 vim_free(tp); |
3514 } | 3523 } |
3515 | 3524 |
3516 /* | 3525 /* |
3517 * Create a new Tab page with one window. | 3526 * Create a new Tab page with one window. |
6732 } | 6741 } |
6733 #endif | 6742 #endif |
6734 | 6743 |
6735 #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO) | 6744 #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO) |
6736 int | 6745 int |
6737 get_win_number(win_T *wp) | 6746 get_win_number(win_T *wp, win_T *first_win) |
6738 { | 6747 { |
6739 int i = 1; | 6748 int i = 1; |
6740 win_T *w; | 6749 win_T *w; |
6741 | 6750 |
6742 for (w = firstwin; w != NULL && w != wp; w = W_NEXT(w)) | 6751 for (w = first_win; w != NULL && w != wp; w = W_NEXT(w)) |
6743 ++i; | 6752 ++i; |
6744 | 6753 |
6745 if (w == NULL) | 6754 if (w == NULL) |
6746 return 0; | 6755 return 0; |
6747 else | 6756 else |
6748 return i; | 6757 return i; |
6749 } | 6758 } |
6750 #endif | 6759 |
6760 int | |
6761 get_tab_number(tabpage_T *tp) | |
6762 { | |
6763 int i = 1; | |
6764 tabpage_T *t; | |
6765 | |
6766 for (t = first_tabpage; t != NULL && t != tp; t = t->tp_next) | |
6767 ++i; | |
6768 | |
6769 if (t == NULL) | |
6770 return 0; | |
6771 else | |
6772 return i; | |
6773 } | |
6774 #endif |