]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.452 v7.3.452
authorBram Moolenaar <Bram@vim.org>
Wed, 22 Feb 2012 16:38:00 +0000 (17:38 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 22 Feb 2012 16:38:00 +0000 (17:38 +0100)
Problem:    Undo broken when pasting close to the last line. (Andrey Radev)
Solution:   Use a flag to remember if the deleted included the last line.
            (Christian Brabandt)

src/ops.c
src/version.c

index 971e3244dd96542ad258202851a37dc531258f97..e8362cd5f56449b18c058efdf2fc39d2c6ac88a6 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -1943,12 +1943,14 @@ op_delete(oap)
        else                            /* delete characters between lines */
        {
            pos_T   curpos;
+           int     delete_last_line;
 
            /* save deleted and changed lines for undo */
            if (u_save((linenr_T)(curwin->w_cursor.lnum - 1),
                 (linenr_T)(curwin->w_cursor.lnum + oap->line_count)) == FAIL)
                return FAIL;
 
+           delete_last_line = (oap->end.lnum == curbuf->b_ml.ml_line_count);
            truncate_line(TRUE);        /* delete from cursor to end of line */
 
            curpos = curwin->w_cursor;  /* remember curwin->w_cursor */
@@ -1956,7 +1958,7 @@ op_delete(oap)
            del_lines((long)(oap->line_count - 2), FALSE);
 
            n = (oap->end.col + 1 - !oap->inclusive);
-           if (oap->inclusive && oap->end.lnum == curbuf->b_ml.ml_line_count
+           if (oap->inclusive && delete_last_line
                    && n > (int)STRLEN(ml_get(oap->end.lnum)))
            {
                /* Special case: gH<Del> deletes the last line. */
index f9da5db7aca2de478cf9f7b4bfffc0974d870396..0b6c063b38a933b158e1e3c4bf4a365b093a7f01 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    452,
 /**/
     451,
 /**/