0
0
mirror of https://github.com/vim/vim.git synced 2025-07-24 10:45:12 -04:00

updated for version 7.3.318

Problem:    "C" on the last line deletes that line if it's blank.
Solution:   Only delete the last line for a delete operation. (James Vega)
This commit is contained in:
Bram Moolenaar 2011-09-21 17:33:53 +02:00
parent 38e2b0636b
commit a554a1933c
2 changed files with 8 additions and 4 deletions

View File

@ -1922,7 +1922,9 @@ op_delete(oap)
curwin->w_cursor.coladd = 0; curwin->w_cursor.coladd = 0;
} }
#endif #endif
if (oap->inclusive && oap->end.lnum == curbuf->b_ml.ml_line_count if (oap->op_type == OP_DELETE
&& oap->inclusive
&& oap->end.lnum == curbuf->b_ml.ml_line_count
&& n > (int)STRLEN(ml_get(oap->end.lnum))) && n > (int)STRLEN(ml_get(oap->end.lnum)))
{ {
/* Special case: gH<Del> deletes the last line. */ /* Special case: gH<Del> deletes the last line. */
@ -3331,8 +3333,8 @@ do_put(regname, dir, count, flags)
if (regname == '=') if (regname == '=')
{ {
/* For the = register we need to split the string at NL /* For the = register we need to split the string at NL
* characters. */ * characters.
/* Loop twice: count the number of lines and save them. */ * Loop twice: count the number of lines and save them. */
for (;;) for (;;)
{ {
y_size = 0; y_size = 0;
@ -3348,7 +3350,7 @@ do_put(regname, dir, count, flags)
if (y_array != NULL) if (y_array != NULL)
*ptr = NUL; *ptr = NUL;
++ptr; ++ptr;
/* A trailing '\n' makes the string linewise */ /* A trailing '\n' makes the register linewise. */
if (*ptr == NUL) if (*ptr == NUL)
{ {
y_type = MLINE; y_type = MLINE;

View File

@ -709,6 +709,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 */
/**/
318,
/**/ /**/
317, 317,
/**/ /**/