Mercurial > vim
changeset 10741:3f70b142e8da v8.0.0260
patch 8.0.0260: build fails with tiny features
commit https://github.com/vim/vim/commit/dea2570740a79c9f2c6ce723689e563f19aff5cf
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 29 15:18:10 2017 +0100
patch 8.0.0260: build fails with tiny features
Problem: Build fails with tiny features.
Solution: Move get_tabpage_arg() inside #ifdef.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 29 Jan 2017 15:30:04 +0100 |
parents | d3f75123cbc5 |
children | 3b87b3cadc7c |
files | src/ex_docmd.c src/version.c |
diffstat | 2 files changed, 100 insertions(+), 98 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -5485,104 +5485,6 @@ getargopt(exarg_T *eap) } /* - * Handle the argument for a tabpage related ex command. - * Returns a tabpage number. - * When an error is encountered then eap->errmsg is set. - */ - static int -get_tabpage_arg(exarg_T *eap) -{ - int tab_number; - int unaccept_arg0 = (eap->cmdidx == CMD_tabmove) ? 0 : 1; - - if (eap->arg && *eap->arg != NUL) - { - char_u *p = eap->arg; - char_u *p_save; - int relative = 0; /* argument +N/-N means: go to N places to the - * right/left relative to the current position. */ - - if (*p == '-') - { - relative = -1; - p++; - } - else if (*p == '+') - { - relative = 1; - p++; - } - - p_save = p; - tab_number = getdigits(&p); - - if (relative == 0) - { - if (STRCMP(p, "$") == 0) - tab_number = LAST_TAB_NR; - else if (p == p_save || *p_save == '-' || *p != NUL - || tab_number > LAST_TAB_NR) - { - /* No numbers as argument. */ - eap->errmsg = e_invarg; - goto theend; - } - } - else - { - if (*p_save == NUL) - tab_number = 1; - else if (p == p_save || *p_save == '-' || *p != NUL - || tab_number == 0) - { - /* No numbers as argument. */ - eap->errmsg = e_invarg; - goto theend; - } - tab_number = tab_number * relative + tabpage_index(curtab); - if (!unaccept_arg0 && relative == -1) - --tab_number; - } - if (tab_number < unaccept_arg0 || tab_number > LAST_TAB_NR) - eap->errmsg = e_invarg; - } - else if (eap->addr_count > 0) - { - if (unaccept_arg0 && eap->line2 == 0) - eap->errmsg = e_invrange; - else - { - tab_number = eap->line2; - if (!unaccept_arg0 && **eap->cmdlinep == '-') - { - --tab_number; - if (tab_number < unaccept_arg0) - eap->errmsg = e_invarg; - } - } - } - else - { - switch (eap->cmdidx) - { - case CMD_tabnext: - tab_number = tabpage_index(curtab) + 1; - if (tab_number > LAST_TAB_NR) - tab_number = 1; - break; - case CMD_tabmove: - tab_number = LAST_TAB_NR; - break; - default: - tab_number = tabpage_index(curtab); - } - } - -theend: - return tab_number; -} - -/* * ":abbreviate" and friends. */ static void @@ -7567,6 +7469,104 @@ ex_win_close( } /* + * Handle the argument for a tabpage related ex command. + * Returns a tabpage number. + * When an error is encountered then eap->errmsg is set. + */ + static int +get_tabpage_arg(exarg_T *eap) +{ + int tab_number; + int unaccept_arg0 = (eap->cmdidx == CMD_tabmove) ? 0 : 1; + + if (eap->arg && *eap->arg != NUL) + { + char_u *p = eap->arg; + char_u *p_save; + int relative = 0; /* argument +N/-N means: go to N places to the + * right/left relative to the current position. */ + + if (*p == '-') + { + relative = -1; + p++; + } + else if (*p == '+') + { + relative = 1; + p++; + } + + p_save = p; + tab_number = getdigits(&p); + + if (relative == 0) + { + if (STRCMP(p, "$") == 0) + tab_number = LAST_TAB_NR; + else if (p == p_save || *p_save == '-' || *p != NUL + || tab_number > LAST_TAB_NR) + { + /* No numbers as argument. */ + eap->errmsg = e_invarg; + goto theend; + } + } + else + { + if (*p_save == NUL) + tab_number = 1; + else if (p == p_save || *p_save == '-' || *p != NUL + || tab_number == 0) + { + /* No numbers as argument. */ + eap->errmsg = e_invarg; + goto theend; + } + tab_number = tab_number * relative + tabpage_index(curtab); + if (!unaccept_arg0 && relative == -1) + --tab_number; + } + if (tab_number < unaccept_arg0 || tab_number > LAST_TAB_NR) + eap->errmsg = e_invarg; + } + else if (eap->addr_count > 0) + { + if (unaccept_arg0 && eap->line2 == 0) + eap->errmsg = e_invrange; + else + { + tab_number = eap->line2; + if (!unaccept_arg0 && **eap->cmdlinep == '-') + { + --tab_number; + if (tab_number < unaccept_arg0) + eap->errmsg = e_invarg; + } + } + } + else + { + switch (eap->cmdidx) + { + case CMD_tabnext: + tab_number = tabpage_index(curtab) + 1; + if (tab_number > LAST_TAB_NR) + tab_number = 1; + break; + case CMD_tabmove: + tab_number = LAST_TAB_NR; + break; + default: + tab_number = tabpage_index(curtab); + } + } + +theend: + return tab_number; +} + +/* * ":tabclose": close current tab page, unless it is the last one. * ":tabclose N": close tab page N. */