summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2009-05-26 16:12:37 +0000
committerBram Moolenaar <Bram@vim.org>2009-05-26 16:12:37 +0000
commit42b9436cf88929bf176d3a812b2840d530c5d522 (patch)
treebec85b357bffefcbb6b0526472197f0a84773d38
parent4be506815db49371c7720e14b1bbe573c44978fe (diff)
downloadvim-git-42b9436cf88929bf176d3a812b2840d530c5d522.tar.gz
updated for version 7.2-190v7.2.190
-rw-r--r--src/ops.c28
-rw-r--r--src/version.c2
2 files changed, 24 insertions, 6 deletions
diff --git a/src/ops.c b/src/ops.c
index c4318da5e..3e595fd42 100644
--- 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
diff --git a/src/version.c b/src/version.c
index d744a0232..7282b6b57 100644
--- a/src/version.c
+++ b/src/version.c
@@ -677,6 +677,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 190,
+/**/
189,
/**/
188,