comparison src/ex_docmd.c @ 9927:e1a8b2601fe0 v7.4.2237

commit https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 21 19:07:17 2016 +0200 patch 7.4.2237 Problem: Can't use "." and "$" with ":tab". Solution: Support a range for ":tab". (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Sun, 21 Aug 2016 19:15:05 +0200
parents 1f33aece8e55
children e975914c17e9
comparison
equal deleted inserted replaced
9926:4a5f95edebca 9927:e1a8b2601fe0
1856 } 1856 }
1857 1857
1858 /* 1858 /*
1859 * 2. Handle command modifiers. 1859 * 2. Handle command modifiers.
1860 */ 1860 */
1861 p = ea.cmd; 1861 p = skip_range(ea.cmd, NULL);
1862 if (VIM_ISDIGIT(*ea.cmd))
1863 p = skipwhite(skipdigits(ea.cmd));
1864 switch (*p) 1862 switch (*p)
1865 { 1863 {
1866 /* When adding an entry, also modify cmd_exists(). */ 1864 /* When adding an entry, also modify cmd_exists(). */
1867 case 'a': if (!checkforcmd(&ea.cmd, "aboveleft", 3)) 1865 case 'a': if (!checkforcmd(&ea.cmd, "aboveleft", 3))
1868 break; 1866 break;
1990 continue; 1988 continue;
1991 1989
1992 case 't': if (checkforcmd(&p, "tab", 3)) 1990 case 't': if (checkforcmd(&p, "tab", 3))
1993 { 1991 {
1994 #ifdef FEAT_WINDOWS 1992 #ifdef FEAT_WINDOWS
1995 if (vim_isdigit(*ea.cmd)) 1993 long tabnr = get_address(&ea, &ea.cmd, ADDR_TABS,
1996 cmdmod.tab = atoi((char *)ea.cmd) + 1; 1994 ea.skip, FALSE);
1995 if (tabnr == MAXLNUM)
1996 cmdmod.tab = tabpage_index(curtab) + 1;
1997 else 1997 else
1998 cmdmod.tab = tabpage_index(curtab) + 1; 1998 {
1999 if (tabnr < 0 || tabnr > LAST_TAB_NR)
2000 {
2001 errormsg = (char_u *)_(e_invrange);
2002 goto doend;
2003 }
2004 cmdmod.tab = tabnr + 1;
2005 }
1999 ea.cmd = p; 2006 ea.cmd = p;
2000 #endif 2007 #endif
2001 continue; 2008 continue;
2002 } 2009 }
2003 if (!checkforcmd(&ea.cmd, "topleft", 2)) 2010 if (!checkforcmd(&ea.cmd, "topleft", 2))