From: Bram Moolenaar Date: Sun, 12 Jul 2015 15:52:57 +0000 (+0200) Subject: patch 7.4.781 X-Git-Tag: v7.4.781 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe6f18687761403470979feef8fe8ce582ae3b60;p=vim patch 7.4.781 Problem: line2byte() returns one less when 'bin' and 'noeol' are set. Solution: Only adjust the size for the last line. (Rob Wu) --- diff --git a/src/memline.c b/src/memline.c index e80936087..91ef270bc 100644 --- a/src/memline.c +++ b/src/memline.c @@ -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; } diff --git a/src/version.c b/src/version.c index c9691dd81..e5f2887be 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 781, /**/ 780, /**/