Mercurial > vim
changeset 6925:30c9301f33ed v7.4.781
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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 12 Jul 2015 17:52:57 +0200 |
parents | 4b0a26cbea81 |
children | b2839b524d9f |
files | src/memline.c src/version.c |
diffstat | 2 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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; }