Mercurial > vim
diff src/memline.c @ 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 | cd47def2214a |
children | 62ba356c2d4e |
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; }