diff options
Diffstat (limited to 'src/nvim/memline.c')
| -rw-r--r-- | src/nvim/memline.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c index f11dc636a3..d90e91be5d 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -587,8 +587,7 @@ void ml_close(buf_T *buf, int del_file) void ml_close_all(int del_file) { FOR_ALL_BUFFERS(buf) { - ml_close(buf, del_file && ((buf->b_flags & BF_PRESERVED) == 0 - || vim_strchr(p_cpo, CPO_PRESERVE) == NULL)); + ml_close(buf, del_file && ((buf->b_flags & BF_PRESERVED) == 0)); } spell_delete_wordlist(); /* delete the internal wordlist */ vim_deltempdir(); /* delete created temp directory */ @@ -3935,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; |