commit | fe6f18687761403470979feef8fe8ce582ae3b60 | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Sun Jul 12 17:52:57 2015 +0200 |
committer | Bram Moolenaar <Bram@vim.org> | Sun Jul 12 17:52:57 2015 +0200 |
tree | d5f5ebb7d4a362c89d908515f70efafb9397f803 | |
parent | 1db43b1145fe466b5d41af6744a08083983de3a9 [diff] [blame] |
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 e809360..91ef270 100644 --- a/src/memline.c +++ b/src/memline.c
@@ -5362,7 +5362,7 @@ 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; }