]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.391 v7.2.391
authorBram Moolenaar <Bram@vim.org>
Wed, 10 Mar 2010 13:46:26 +0000 (14:46 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 10 Mar 2010 13:46:26 +0000 (14:46 +0100)
Problem:    Internal alloc(0) error when doing "CTRL-V $ c". (Martti Kuparinen)
Solution:   Fix computations in getvcol(). (partly by Lech Lorens)

src/charset.c
src/memline.c
src/version.c

index 5b0e71c8a45e13e2f08be2a0dcc4bd1c6bddd534..ef162e4a47c79364fef496d3d2e8365f5d9f8f3e 100644 (file)
@@ -1255,7 +1255,10 @@ getvcol(wp, pos, start, cursor, end)
 
     vcol = 0;
     ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE);
-    posptr = ptr + pos->col;
+    if (pos->col == MAXCOL)
+       posptr = NULL;  /* continue until the NUL */
+    else
+       posptr = ptr + pos->col;
 
     /*
      * This function is used very often, do some speed optimizations.
@@ -1313,7 +1316,7 @@ getvcol(wp, pos, start, cursor, end)
                    incr = CHARSIZE(c);
            }
 
-           if (ptr >= posptr)  /* character at pos->col */
+           if (posptr != NULL && ptr >= posptr) /* character at pos->col */
                break;
 
            vcol += incr;
@@ -1334,7 +1337,7 @@ getvcol(wp, pos, start, cursor, end)
                break;
            }
 
-           if (ptr >= posptr)  /* character at pos->col */
+           if (posptr != NULL && ptr >= posptr) /* character at pos->col */
                break;
 
            vcol += incr;
index 29a6e5cca374bbd393392b1101ce4b2d141b8769..102b61e31a65aa0d07e18cd39506fda5851a45b4 100644 (file)
@@ -2113,12 +2113,12 @@ errorret:
     if (buf->b_ml.ml_mfp == NULL)      /* there are no lines */
        return (char_u *)"";
 
-/*
- * See if it is the same line as requested last time.
- * Otherwise may need to flush last used line.
- * Don't use the last used line when 'swapfile' is reset, need to load all
- * blocks.
- */
+    /*
    * See if it is the same line as requested last time.
    * Otherwise may need to flush last used line.
    * Don't use the last used line when 'swapfile' is reset, need to load all
    * blocks.
    */
     if (buf->b_ml.ml_line_lnum != lnum || mf_dont_release)
     {
        ml_flush_line(buf);
index 18f3ba5c4ef46b39923af4737f2c9b05efceeb61..a635aad7ad757dbc7bed418c94ceefb96aa5fdff 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    391,
 /**/
     390,
 /**/