0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.2-190

This commit is contained in:
Bram Moolenaar
2009-05-26 16:12:37 +00:00
parent 4be506815d
commit 42b9436cf8
2 changed files with 24 additions and 6 deletions

View File

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

View File

@@ -676,6 +676,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
190,
/**/ /**/
189, 189,
/**/ /**/