diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-05-18 22:24:46 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-05-18 22:24:46 +0000 |
commit | 34cdc3e32917a3812a8ec4369c64ef3e35243cfd (patch) | |
tree | a192d6da2ccb602a9b265519be64d4c170e2d8e3 /src/ex_cmds2.c | |
parent | a7fc0101b2c5feb7fc70eb79e5b02c61c7de545f (diff) | |
download | vim-git-34cdc3e32917a3812a8ec4369c64ef3e35243cfd.tar.gz |
updated for version 7.0072v7.0072
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r-- | src/ex_cmds2.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 4dc0f0cc1..f9e1e5a93 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -141,7 +141,14 @@ do_debug(cmd) if (sourcing_name != NULL) msg(sourcing_name); if (sourcing_lnum != 0) - smsg((char_u *)_("line %ld: %s"), (long)sourcing_lnum, cmd); + { + char_u buf[IOSIZE]; + + /* Truncate the command, the whole must fit in IObuff. */ + STRNCPY(buf, cmd, IOSIZE - 50); + buf[IOSIZE - 50] = NUL; + smsg((char_u *)_("line %ld: %s"), (long)sourcing_lnum, buf); + } else msg_str((char_u *)_("cmd: %s"), cmd); @@ -1942,6 +1949,7 @@ do_argfile(eap, argn) { int other; char_u *p; + int old_arg_idx = curwin->w_arg_idx; if (argn < 0 || argn >= ARGCOUNT) { @@ -1995,14 +2003,16 @@ do_argfile(eap, argn) ) arg_had_last = TRUE; - /* Edit the file; always use the last known line number. */ - (void)do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL, + /* Edit the file; always use the last known line number. + * When it fails (e.g. Abort for already edited file) restore the + * argument index. */ + if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL, eap, ECMD_LAST, (P_HID(curwin->w_buffer) ? ECMD_HIDE : 0) + - (eap->forceit ? ECMD_FORCEIT : 0)); - + (eap->forceit ? ECMD_FORCEIT : 0)) == FAIL) + curwin->w_arg_idx = old_arg_idx; /* like Vi: set the mark where the cursor is in the file. */ - if (eap->cmdidx != CMD_argdo) + else if (eap->cmdidx != CMD_argdo) setmark('\''); } } @@ -2463,8 +2473,14 @@ do_in_runtimepath(name, all, callback, cookie) if (buf != NULL && rtp_copy != NULL) { if (p_verbose > 1) - smsg((char_u *)_("Searching for \"%s\" in \"%s\""), + { + if (STRLEN(name) + STRLEN(p_rtp) > IOSIZE - 100) + MSG(_("Searching for a long name in 'runtimepath'")); + else + smsg((char_u *)_("Searching for \"%s\" in \"%s\""), (char *)name, (char *)p_rtp); + } + /* Loop over all entries in 'runtimepath'. */ rtp = rtp_copy; while (*rtp != NUL && (all || !did_one)) |