mirror of
https://github.com/vim/vim.git
synced 2025-10-06 05:44:14 -04:00
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)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user