summaryrefslogtreecommitdiffstats
path: root/src/memline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/memline.c')
-rw-r--r--src/memline.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/memline.c b/src/memline.c
index 91ef270bc3..8cd9b80b2a 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -5361,8 +5361,10 @@ ml_find_line_or_offset(buf, lnum, offp)
if (ffdos)
size += lnum - 1;
- /* Don't count the last line break if 'bin' and 'noeol'. */
- if (buf->b_p_bin && !buf->b_p_eol && buf->b_ml.ml_line_count == lnum)
+ /* 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)
size -= ffdos + 1;
}