aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-12-13 00:09:07 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-12-13 00:09:07 -0500
commitaca51f3d9314c70a4df0f15bcb84edd2dc127ff0 (patch)
treeb92532b6cec03547d223de16f6219b6f9f653c9a /src/nvim/fileio.c
parentebdb802bf55a45eb7e4fa59cdb0689e7a3323f86 (diff)
parent98f9ff730b276fe029764ad1d657f3eba40a7068 (diff)
downloadrneovim-aca51f3d9314c70a4df0f15bcb84edd2dc127ff0.tar.gz
rneovim-aca51f3d9314c70a4df0f15bcb84edd2dc127ff0.tar.bz2
rneovim-aca51f3d9314c70a4df0f15bcb84edd2dc127ff0.zip
Merge #3443 'vim-patch:7.4.{785,795,898}'
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index bc5b08ef24..87fcddd3e9 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -1922,10 +1922,10 @@ failed:
check_marks_read();
/*
- * Trick: We remember if the last line of the read didn't have
- * an eol even when 'binary' is off, for when writing it again with
- * 'binary' on. This is required for
- * ":autocmd FileReadPost *.gz set bin|'[,']!gunzip" to work.
+ * We remember if the last line of the read didn't have
+ * an eol even when 'binary' is off, to support turning 'fixeol' off,
+ * or writing the read again with 'binary' on. The latter is required
+ * for ":autocmd FileReadPost *.gz set bin|'[,']!gunzip" to work.
*/
curbuf->b_no_eol_lnum = read_no_eol_lnum;
@@ -3310,7 +3310,7 @@ restore_backup:
/* write failed or last line has no EOL: stop here */
if (end == 0
|| (lnum == end
- && write_bin
+ && (write_bin || !buf->b_p_fixeol)
&& (lnum == buf->b_no_eol_lnum
|| (lnum == buf->b_ml.ml_line_count && !buf->b_p_eol)))) {
++lnum; /* written the line, count it */