diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-30 15:46:30 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-30 15:46:30 +0200 |
commit | 8d71b54409ca6cf989dfb7d7fe265768fb7fe062 (patch) | |
tree | 31f394027b56f1dbd68f7723320384e2594c541c /src/eval.c | |
parent | 58a297b28d2a8127c72bd860c4a7175a5e9c97f3 (diff) | |
download | vim-git-8d71b54409ca6cf989dfb7d7fe265768fb7fe062.tar.gz |
patch 8.1.1943: more code can be moved to evalvars.cv8.1.1943
Problem: More code can be moved to evalvars.c.
Solution: Move it, clean up comments. Also move some window related
functions to window.c. (Yegappan Lakshmanan, closes #4874)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/src/eval.c b/src/eval.c index fb2f804e7..f32092c82 100644 --- a/src/eval.c +++ b/src/eval.c @@ -6514,109 +6514,6 @@ ex_execute(exarg_T *eap) } /* - * Find window specified by "vp" in tabpage "tp". - */ - win_T * -find_win_by_nr( - typval_T *vp, - tabpage_T *tp) /* NULL for current tab page */ -{ - win_T *wp; - int nr = (int)tv_get_number_chk(vp, NULL); - - if (nr < 0) - return NULL; - if (nr == 0) - return curwin; - - FOR_ALL_WINDOWS_IN_TAB(tp, wp) - { - if (nr >= LOWEST_WIN_ID) - { - if (wp->w_id == nr) - return wp; - } - else if (--nr <= 0) - break; - } - if (nr >= LOWEST_WIN_ID) - { -#ifdef FEAT_TEXT_PROP - // check tab-local popup windows - for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next) - if (wp->w_id == nr) - return wp; - // check global popup windows - for (wp = first_popupwin; wp != NULL; wp = wp->w_next) - if (wp->w_id == nr) - return wp; -#endif - return NULL; - } - return wp; -} - -/* - * Find a window: When using a Window ID in any tab page, when using a number - * in the current tab page. - */ - win_T * -find_win_by_nr_or_id(typval_T *vp) -{ - int nr = (int)tv_get_number_chk(vp, NULL); - - if (nr >= LOWEST_WIN_ID) - return win_id2wp(tv_get_number(vp)); - return find_win_by_nr(vp, NULL); -} - -/* - * Find window specified by "wvp" in tabpage "tvp". - * Returns the tab page in 'ptp' - */ - win_T * -find_tabwin( - typval_T *wvp, // VAR_UNKNOWN for current window - typval_T *tvp, // VAR_UNKNOWN for current tab page - tabpage_T **ptp) -{ - win_T *wp = NULL; - tabpage_T *tp = NULL; - long n; - - if (wvp->v_type != VAR_UNKNOWN) - { - if (tvp->v_type != VAR_UNKNOWN) - { - n = (long)tv_get_number(tvp); - if (n >= 0) - tp = find_tabpage(n); - } - else - tp = curtab; - - if (tp != NULL) - { - wp = find_win_by_nr(wvp, tp); - if (wp == NULL && wvp->v_type == VAR_NUMBER - && wvp->vval.v_number != -1) - // A window with the specified number is not found - tp = NULL; - } - } - else - { - wp = curwin; - tp = curtab; - } - - if (ptp != NULL) - *ptp = tp; - - return wp; -} - -/* * Skip over the name of an option: "&option", "&g:option" or "&l:option". * "arg" points to the "&" or '+' when called, to "option" when returning. * Returns NULL when no option name found. Otherwise pointer to the char |