diff options
Diffstat (limited to 'src/nvim/memline.c')
| -rw-r--r-- | src/nvim/memline.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 0e415b6e8c..d90e91be5d 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -78,7 +78,7 @@ #include "nvim/os/os.h" #include "nvim/os/input.h" -#ifndef UNIX /* it's in os_unix_defs.h for Unix */ +#ifndef UNIX /* it's in os/unix_defs.h for Unix */ # include <time.h> #endif @@ -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; |