summaryrefslogtreecommitdiff
path: root/src/memline.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-07-17 14:18:08 +0200
committerBram Moolenaar <Bram@vim.org>2015-07-17 14:18:08 +0200
commit34d72d4b6c1a2b04a214d8a49b7d22c97bc7a8bc (patch)
tree82675f2f5f49bcb04e8271de9fefee41b3c2ec19 /src/memline.c
parent2cf6938706ebcd20e4b4a6723f5f70568b26b1c6 (diff)
downloadvim-git-34d72d4b6c1a2b04a214d8a49b7d22c97bc7a8bc.tar.gz
patch 7.4.785v7.4.785
Problem: On some systems automatically adding the missing EOL causes problems. Setting 'binary' has too many side effects. Solution: Add the 'fixeol' option, default on. (Pavel Samarkin)
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 91ef270bc..8cd9b80b2 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;
}