0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

updated for version 7.0043

This commit is contained in:
Bram Moolenaar
2005-01-21 11:46:23 +00:00
parent ce5e58e601
commit ca4729948b
3 changed files with 60 additions and 18 deletions

View File

@@ -7509,27 +7509,28 @@ ex_redir(eap)
{ {
char *mode; char *mode;
char_u *fname; char_u *fname;
char_u *arg = eap->arg;
if (STRICMP(eap->arg, "END") == 0) if (STRICMP(eap->arg, "END") == 0)
close_redir(); close_redir();
else else
{ {
if (*eap->arg == '>') if (*arg == '>')
{ {
++eap->arg; ++arg;
if (*eap->arg == '>') if (*arg == '>')
{ {
++eap->arg; ++arg;
mode = "a"; mode = "a";
} }
else else
mode = "w"; mode = "w";
eap->arg = skipwhite(eap->arg); arg = skipwhite(arg);
close_redir(); close_redir();
/* Expand environment variables and "~/". */ /* Expand environment variables and "~/". */
fname = expand_env_save(eap->arg); fname = expand_env_save(arg);
if (fname == NULL) if (fname == NULL)
return; return;
#ifdef FEAT_BROWSE #ifdef FEAT_BROWSE
@@ -7552,30 +7553,34 @@ ex_redir(eap)
vim_free(fname); vim_free(fname);
} }
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
else if (*eap->arg == '@') else if (*arg == '@')
{ {
/* redirect to a register a-z (resp. A-Z for appending) */ /* redirect to a register a-z (resp. A-Z for appending) */
close_redir(); close_redir();
++eap->arg; ++arg;
if (ASCII_ISALPHA(*eap->arg) if (ASCII_ISALPHA(*arg)
# ifdef FEAT_CLIPBOARD # ifdef FEAT_CLIPBOARD
|| *eap->arg == '*' || *arg == '*'
# endif # endif
|| *eap->arg == '"') || *arg == '"')
{ {
redir_reg = *eap->arg; redir_reg = *arg++;
if (islower(redir_reg) if (*arg == '>')
++arg;
else if (*arg == NUL && (islower(redir_reg)
# ifdef FEAT_CLIPBOARD # ifdef FEAT_CLIPBOARD
|| redir_reg == '*' || redir_reg == '*'
# endif # endif
|| redir_reg == '"') || redir_reg == '"'))
{ {
/* make register empty */ /* make register empty */
write_reg_contents(redir_reg, (char_u *)"", -1, FALSE); write_reg_contents(redir_reg, (char_u *)"", -1, FALSE);
} }
if (*arg != NUL)
EMSG2(_(e_invarg2), eap->arg);
} }
else else
EMSG(_(e_invarg)); EMSG2(_(e_invarg2), eap->arg);
} }
#endif #endif
@@ -7584,7 +7589,7 @@ ex_redir(eap)
/* TODO: redirect to an internal variable */ /* TODO: redirect to an internal variable */
else else
EMSG(_(e_invarg)); EMSG2(_(e_invarg2), eap->arg);
} }
} }
@@ -7743,7 +7748,8 @@ ex_mkrc(eap)
#if defined(FEAT_SESSION) && defined(vim_mkdir) #if defined(FEAT_SESSION) && defined(vim_mkdir)
/* When using 'viewdir' may have to create the directory. */ /* When using 'viewdir' may have to create the directory. */
if (using_vdir && !mch_isdir(p_vdir)) 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 #endif
fd = open_exfile(fname, eap->forceit, WRITEBIN); fd = open_exfile(fname, eap->forceit, WRITEBIN);

View File

@@ -280,9 +280,11 @@ EXTERN scid_T current_SID INIT(= 0); /* ID of script being sourced or
current function. */ current function. */
#endif #endif
#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL)
/* Magic number used for hashitem "hi_key" value indicating a deleted item. /* Magic number used for hashitem "hi_key" value indicating a deleted item.
* Only the address is used. */ * Only the address is used. */
EXTERN char_u hash_removed; EXTERN char_u hash_removed;
#endif
EXTERN int scroll_region INIT(= FALSE); /* term supports scroll region */ EXTERN int scroll_region INIT(= FALSE); /* term supports scroll region */
@@ -1396,7 +1398,9 @@ EXTERN char_u e_invexprmsg[] INIT(=N_("E449: Invalid expression received"));
EXTERN char_u e_guarded[] INIT(=N_("E463: Region is guarded, cannot modify")); 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")); EXTERN char_u e_nbreadonly[] INIT(=N_("E680: NetBeans does not allow changes in read-only files"));
#endif #endif
#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL)
EXTERN char_u e_intern2[] INIT(=N_("E685: Internal error: %s")); EXTERN char_u e_intern2[] INIT(=N_("E685: Internal error: %s"));
#endif
#ifdef MACOS_X_UNIX #ifdef MACOS_X_UNIX

32
src/testdir/test.ok Normal file
View File

@@ -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: