Mercurial > vim
changeset 122:56eb9755174b
updated for version 7.0043
author | vimboss |
---|---|
date | Fri, 21 Jan 2005 11:46:23 +0000 |
parents | 86d71ae0c85a |
children | f67f8a8d81ba |
files | src/ex_docmd.c src/globals.h src/testdir/test.ok |
diffstat | 3 files changed, 63 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -7509,27 +7509,28 @@ ex_redir(eap) { char *mode; char_u *fname; + char_u *arg = eap->arg; if (STRICMP(eap->arg, "END") == 0) close_redir(); else { - if (*eap->arg == '>') - { - ++eap->arg; - if (*eap->arg == '>') - { - ++eap->arg; + if (*arg == '>') + { + ++arg; + if (*arg == '>') + { + ++arg; mode = "a"; } else mode = "w"; - eap->arg = skipwhite(eap->arg); + arg = skipwhite(arg); close_redir(); /* Expand environment variables and "~/". */ - fname = expand_env_save(eap->arg); + fname = expand_env_save(arg); if (fname == NULL) return; #ifdef FEAT_BROWSE @@ -7552,30 +7553,34 @@ ex_redir(eap) vim_free(fname); } #ifdef FEAT_EVAL - else if (*eap->arg == '@') + else if (*arg == '@') { /* redirect to a register a-z (resp. A-Z for appending) */ close_redir(); - ++eap->arg; - if (ASCII_ISALPHA(*eap->arg) + ++arg; + if (ASCII_ISALPHA(*arg) # ifdef FEAT_CLIPBOARD - || *eap->arg == '*' + || *arg == '*' # endif - || *eap->arg == '"') - { - redir_reg = *eap->arg; - if (islower(redir_reg) + || *arg == '"') + { + redir_reg = *arg++; + if (*arg == '>') + ++arg; + else if (*arg == NUL && (islower(redir_reg) # ifdef FEAT_CLIPBOARD - || redir_reg == '*' + || redir_reg == '*' # endif - || redir_reg == '"') + || redir_reg == '"')) { /* make register empty */ write_reg_contents(redir_reg, (char_u *)"", -1, FALSE); } + if (*arg != NUL) + EMSG2(_(e_invarg2), eap->arg); } else - EMSG(_(e_invarg)); + EMSG2(_(e_invarg2), eap->arg); } #endif @@ -7584,7 +7589,7 @@ ex_redir(eap) /* TODO: redirect to an internal variable */ else - EMSG(_(e_invarg)); + EMSG2(_(e_invarg2), eap->arg); } } @@ -7743,7 +7748,8 @@ ex_mkrc(eap) #if defined(FEAT_SESSION) && defined(vim_mkdir) /* When using 'viewdir' may have to create the directory. */ if (using_vdir && !mch_isdir(p_vdir)) - vim_mkdir(p_vdir, 0755); /* ignore errors, open_exfile() will fail */ + if (vim_mkdir(p_vdir, 0755) != 0) + EMSG2(_("E738: Cannot create directory: %s"), p_vdir); #endif fd = open_exfile(fname, eap->forceit, WRITEBIN);
--- a/src/globals.h +++ b/src/globals.h @@ -280,9 +280,11 @@ EXTERN scid_T current_SID INIT(= 0); current function. */ #endif +#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) /* Magic number used for hashitem "hi_key" value indicating a deleted item. * Only the address is used. */ EXTERN char_u hash_removed; +#endif EXTERN int scroll_region INIT(= FALSE); /* term supports scroll region */ @@ -1396,7 +1398,9 @@ EXTERN char_u e_invexprmsg[] INIT(=N_("E EXTERN char_u e_guarded[] INIT(=N_("E463: Region is guarded, cannot modify")); EXTERN char_u e_nbreadonly[] INIT(=N_("E680: NetBeans does not allow changes in read-only files")); #endif +#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) EXTERN char_u e_intern2[] INIT(=N_("E685: Internal error: %s")); +#endif #ifdef MACOS_X_UNIX
new file mode 100644 --- /dev/null +++ b/src/testdir/test.ok @@ -0,0 +1,32 @@ +start: +[1, 'as''d', [1, 2, function('strlen')], {'a': 1}] +{'a': 1} +1 +Vim(put):E684: +101101 +{'1': 'asd', 'b': [1, 2, function('strlen')], '-1': {'a': 1}}asd +['-1', '1', 'b'] +['asd', [1, 2, function('strlen')], {'a': 1}] +1:'asd' +b:[1, 2, function('strlen')] +-1:{'a': 1} +Vim(call):E737: 3 +{'c': 'ccc', '1': 99, 'b': [1, 2, function('strlen')], '3': 33, '-1': {'a': 1}} +{'c': 'ccc', '1': 99, '3': 33, '-1': {'a': 1}} +101101 +Vim(let):E706: d +Vim(let):E706: l +[1, 'as''d', {'a': 1}] +[4] +{'1': 99, '3': 33} +3000 2900 2001 1600 1501 +Vim(let):E716: 1500 +NONE 2999 +33=999 +{'33': 999} +len: 3 +again: 3 +Vim(call):E725: +g:dict.func-4 +a:function('3') +Vim(let):E698: