Mercurial > vim
comparison src/ex_cmds2.c @ 271:8d34af900bae v7.0072
updated for version 7.0072
author | vimboss |
---|---|
date | Wed, 18 May 2005 22:24:46 +0000 |
parents | 62a331864307 |
children | 8fa8d7964cf1 |
comparison
equal
deleted
inserted
replaced
270:a20218704019 | 271:8d34af900bae |
---|---|
139 if (!debug_did_msg) | 139 if (!debug_did_msg) |
140 MSG(_("Entering Debug mode. Type \"cont\" to continue.")); | 140 MSG(_("Entering Debug mode. Type \"cont\" to continue.")); |
141 if (sourcing_name != NULL) | 141 if (sourcing_name != NULL) |
142 msg(sourcing_name); | 142 msg(sourcing_name); |
143 if (sourcing_lnum != 0) | 143 if (sourcing_lnum != 0) |
144 smsg((char_u *)_("line %ld: %s"), (long)sourcing_lnum, cmd); | 144 { |
145 char_u buf[IOSIZE]; | |
146 | |
147 /* Truncate the command, the whole must fit in IObuff. */ | |
148 STRNCPY(buf, cmd, IOSIZE - 50); | |
149 buf[IOSIZE - 50] = NUL; | |
150 smsg((char_u *)_("line %ld: %s"), (long)sourcing_lnum, buf); | |
151 } | |
145 else | 152 else |
146 msg_str((char_u *)_("cmd: %s"), cmd); | 153 msg_str((char_u *)_("cmd: %s"), cmd); |
147 | 154 |
148 /* | 155 /* |
149 * Repeat getting a command and executing it. | 156 * Repeat getting a command and executing it. |
1940 exarg_T *eap; | 1947 exarg_T *eap; |
1941 int argn; | 1948 int argn; |
1942 { | 1949 { |
1943 int other; | 1950 int other; |
1944 char_u *p; | 1951 char_u *p; |
1952 int old_arg_idx = curwin->w_arg_idx; | |
1945 | 1953 |
1946 if (argn < 0 || argn >= ARGCOUNT) | 1954 if (argn < 0 || argn >= ARGCOUNT) |
1947 { | 1955 { |
1948 if (ARGCOUNT <= 1) | 1956 if (ARGCOUNT <= 1) |
1949 EMSG(_("E163: There is only one file to edit")); | 1957 EMSG(_("E163: There is only one file to edit")); |
1993 && curwin->w_alist == &global_alist | 2001 && curwin->w_alist == &global_alist |
1994 #endif | 2002 #endif |
1995 ) | 2003 ) |
1996 arg_had_last = TRUE; | 2004 arg_had_last = TRUE; |
1997 | 2005 |
1998 /* Edit the file; always use the last known line number. */ | 2006 /* Edit the file; always use the last known line number. |
1999 (void)do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL, | 2007 * When it fails (e.g. Abort for already edited file) restore the |
2008 * argument index. */ | |
2009 if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL, | |
2000 eap, ECMD_LAST, | 2010 eap, ECMD_LAST, |
2001 (P_HID(curwin->w_buffer) ? ECMD_HIDE : 0) + | 2011 (P_HID(curwin->w_buffer) ? ECMD_HIDE : 0) + |
2002 (eap->forceit ? ECMD_FORCEIT : 0)); | 2012 (eap->forceit ? ECMD_FORCEIT : 0)) == FAIL) |
2003 | 2013 curwin->w_arg_idx = old_arg_idx; |
2004 /* like Vi: set the mark where the cursor is in the file. */ | 2014 /* like Vi: set the mark where the cursor is in the file. */ |
2005 if (eap->cmdidx != CMD_argdo) | 2015 else if (eap->cmdidx != CMD_argdo) |
2006 setmark('\''); | 2016 setmark('\''); |
2007 } | 2017 } |
2008 } | 2018 } |
2009 | 2019 |
2010 /* | 2020 /* |
2461 rtp_copy = vim_strsave(p_rtp); | 2471 rtp_copy = vim_strsave(p_rtp); |
2462 buf = alloc(MAXPATHL); | 2472 buf = alloc(MAXPATHL); |
2463 if (buf != NULL && rtp_copy != NULL) | 2473 if (buf != NULL && rtp_copy != NULL) |
2464 { | 2474 { |
2465 if (p_verbose > 1) | 2475 if (p_verbose > 1) |
2466 smsg((char_u *)_("Searching for \"%s\" in \"%s\""), | 2476 { |
2477 if (STRLEN(name) + STRLEN(p_rtp) > IOSIZE - 100) | |
2478 MSG(_("Searching for a long name in 'runtimepath'")); | |
2479 else | |
2480 smsg((char_u *)_("Searching for \"%s\" in \"%s\""), | |
2467 (char *)name, (char *)p_rtp); | 2481 (char *)name, (char *)p_rtp); |
2482 } | |
2483 | |
2468 /* Loop over all entries in 'runtimepath'. */ | 2484 /* Loop over all entries in 'runtimepath'. */ |
2469 rtp = rtp_copy; | 2485 rtp = rtp_copy; |
2470 while (*rtp != NUL && (all || !did_one)) | 2486 while (*rtp != NUL && (all || !did_one)) |
2471 { | 2487 { |
2472 /* Copy the path from 'runtimepath' to buf[]. */ | 2488 /* Copy the path from 'runtimepath' to buf[]. */ |