]> granicus.if.org Git - vim/commitdiff
patch 7.4.781 v7.4.781
authorBram Moolenaar <Bram@vim.org>
Sun, 12 Jul 2015 15:52:57 +0000 (17:52 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 Jul 2015 15:52:57 +0000 (17:52 +0200)
Problem:    line2byte() returns one less when 'bin' and 'noeol' are set.
Solution:   Only adjust the size for the last line. (Rob Wu)

src/memline.c
src/version.c

index e80936087f10f73dc4a2a1f61d6d4dfa163e2378..91ef270bc30f79636ab3d09b42fdf255e133930f 100644 (file)
@@ -5362,7 +5362,7 @@ ml_find_line_or_offset(buf, lnum, offp)
            size += lnum - 1;
 
        /* Don't count the last line break if 'bin' and 'noeol'. */
-       if (buf->b_p_bin && !buf->b_p_eol)
+       if (buf->b_p_bin && !buf->b_p_eol && buf->b_ml.ml_line_count == lnum)
            size -= ffdos + 1;
     }
 
index c9691dd81fea456f650508857dd40775bf712400..e5f2887bec353ee1c1e017bad1d52423742a0efe 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    781,
 /**/
     780,
 /**/