mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.781 #3065
Problem: line2byte() returns one less when 'bin' and 'noeol' are set. Solution: Only adjust the size for the last line. (Rob Wu) Original patch: https://code.google.com/p/vim/source/detail?r=30c9301f33ed76d0b76b9e22362f5e78e26786da
This commit is contained in:
parent
990c0350ab
commit
21c0d87a24
@ -3934,8 +3934,9 @@ long ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *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;
|
||||
}
|
||||
}
|
||||
|
||||
return size;
|
||||
|
@ -80,7 +80,7 @@ static int included_patches[] = {
|
||||
784,
|
||||
//783,
|
||||
//782,
|
||||
//781,
|
||||
781,
|
||||
//780,
|
||||
//779,
|
||||
//778,
|
||||
|
Loading…
Reference in New Issue
Block a user