]> granicus.if.org Git - vim/commitdiff
updated for version 7.0043
authorBram Moolenaar <Bram@vim.org>
Fri, 21 Jan 2005 11:46:23 +0000 (11:46 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 21 Jan 2005 11:46:23 +0000 (11:46 +0000)
src/ex_docmd.c
src/globals.h
src/testdir/test.ok [new file with mode: 0644]

index 44c290d1f3a905eef3d20b8b30ab50da4fb79f79..47f7c64b981553e6ae89931892aed76cd133cc16 100644 (file)
@@ -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 == '>')
+       if (*arg == '>')
        {
-           ++eap->arg;
-           if (*eap->arg == '>')
+           ++arg;
+           if (*arg == '>')
            {
-               ++eap->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 == '"')
+                   || *arg == '"')
            {
-               redir_reg = *eap->arg;
-               if (islower(redir_reg)
+               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);
index effb4e2b1aa1cb47ebc34c015165d25ed41aecaa..8cac0f761d93294903d6134048b8d944ac0bac22 100644 (file)
@@ -280,9 +280,11 @@ EXTERN scid_T      current_SID INIT(= 0);      /* ID of script being sourced or
                                               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_("E449: Invalid expression received"));
 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
diff --git a/src/testdir/test.ok b/src/testdir/test.ok
new file mode 100644 (file)
index 0000000..868b116
--- /dev/null
@@ -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: