]> granicus.if.org Git - vim/commitdiff
updated for version 7.2-190 v7.2.190
authorBram Moolenaar <Bram@vim.org>
Tue, 26 May 2009 16:12:37 +0000 (16:12 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 26 May 2009 16:12:37 +0000 (16:12 +0000)
src/ops.c
src/version.c

index c4318da5ecf05fa14e70140d1b5e600d127331d9..3e595fd427cfb896f32de95a34c56c6746f88572 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -1143,6 +1143,8 @@ stuff_yank(regname, p)
     return OK;
 }
 
+static int execreg_lastc = NUL;
+
 /*
  * execute a yank register: copy it into the stuff buffer
  *
@@ -1155,7 +1157,6 @@ do_execreg(regname, colon, addcr, silent)
     int            addcr;              /* always add '\n' to end of line */
     int            silent;             /* set "silent" flag in typeahead buffer */
 {
-    static int lastc = NUL;
     long       i;
     char_u     *p;
     int                retval = OK;
@@ -1163,12 +1164,12 @@ do_execreg(regname, colon, addcr, silent)
 
     if (regname == '@')                        /* repeat previous one */
     {
-       if (lastc == NUL)
+       if (execreg_lastc == NUL)
        {
            EMSG(_("E748: No previously used register"));
            return FAIL;
        }
-       regname = lastc;
+       regname = execreg_lastc;
     }
                                        /* check for valid regname */
     if (regname == '%' || regname == '#' || !valid_yank_reg(regname, FALSE))
@@ -1176,7 +1177,7 @@ do_execreg(regname, colon, addcr, silent)
        emsg_invreg(regname);
        return FAIL;
     }
-    lastc = regname;
+    execreg_lastc = regname;
 
 #ifdef FEAT_CLIPBOARD
     regname = may_get_selection(regname);
@@ -5337,11 +5338,14 @@ read_viminfo_register(virp, force)
 
     /* We only get here (hopefully) if line[0] == '"' */
     str = virp->vir_line + 1;
+
+    /* If the line starts with "" this is the y_previous register. */
     if (*str == '"')
     {
        set_prev = TRUE;
        str++;
     }
+
     if (!ASCII_ISALNUM(*str) && *str != '-')
     {
        if (viminfo_error("E577: ", _("Illegal register name"), virp->vir_line))
@@ -5351,6 +5355,14 @@ read_viminfo_register(virp, force)
     get_yank_register(*str++, FALSE);
     if (!force && y_current->y_array != NULL)
        do_it = FALSE;
+
+    if (*str == '@')
+    {
+       /* "x@: register x used for @@ */
+       if (force || execreg_lastc == NUL)
+           execreg_lastc = str[-1];
+    }
+
     size = 0;
     limit = 100;       /* Optimized for registers containing <= 100 lines */
     if (do_it)
@@ -5360,7 +5372,7 @@ read_viminfo_register(virp, force)
        vim_free(y_current->y_array);
        array = y_current->y_array =
                       (char_u **)alloc((unsigned)(limit * sizeof(char_u *)));
-       str = skipwhite(str);
+       str = skipwhite(skiptowhite(str));
        if (STRNCMP(str, "CHAR", 4) == 0)
            y_current->y_type = MCHAR;
 #ifdef FEAT_VISUAL
@@ -5443,6 +5455,7 @@ write_viminfo_registers(fp)
     max_kbyte = get_viminfo_parameter('s');
     if (max_kbyte == 0)
        return;
+
     for (i = 0; i < NUM_REGISTERS; i++)
     {
        if (y_regs[i].y_array == NULL)
@@ -5497,7 +5510,10 @@ write_viminfo_registers(fp)
        if (y_previous == &y_regs[i])
            fprintf(fp, "\"");
        c = get_register_name(i);
-       fprintf(fp, "\"%c\t%s\t%d\n", c, type,
+       fprintf(fp, "\"%c", c);
+       if (c == execreg_lastc)
+           fprintf(fp, "@");
+       fprintf(fp, "\t%s\t%d\n", type,
 #ifdef FEAT_VISUAL
                    (int)y_regs[i].y_width
 #else
index d744a02329ef9ebf9ebcf835c610613c2169bf66..7282b6b574927ad9014d8b8466c6fbc2e4c598ed 100644 (file)
@@ -676,6 +676,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    190,
 /**/
     189,
 /**/