mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 10:56:31 +00:00
vim-patch:8.1.0303: line2byte() is wrong for last line with 'noeol'
Problem: line2byte() is wrong for last line with 'noeol' and 'nofixeol'.
Solution: Fix off-by-one error. (Shane Harper, closes vim/vim#3351)
c26f7c6053
This commit is contained in:
@@ -3955,7 +3955,7 @@ long ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp)
|
||||
/* Don't count the last line break if 'noeol' and ('bin' or
|
||||
* 'nofixeol'). */
|
||||
if ((!buf->b_p_fixeol || buf->b_p_bin) && !buf->b_p_eol
|
||||
&& buf->b_ml.ml_line_count == lnum) {
|
||||
&& lnum > buf->b_ml.ml_line_count) {
|
||||
size -= ffdos + 1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user