aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-09 19:24:41 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-02-09 19:24:41 +0800
commit47a98ab3941fbb664879f67aa0270a9f93d2bed4 (patch)
tree3f5329a1d4071ac0503cf4cb3ce8b0d2bf678e93 /src/nvim/fileio.c
parent92e43945627ac71ef160e3ecde1bf2913385c7d1 (diff)
downloadrneovim-47a98ab3941fbb664879f67aa0270a9f93d2bed4.tar.gz
rneovim-47a98ab3941fbb664879f67aa0270a9f93d2bed4.tar.bz2
rneovim-47a98ab3941fbb664879f67aa0270a9f93d2bed4.zip
vim-patch:8.2.2199: first write after setting 'eol' does not have NL added
Problem: First write after setting 'eol' does not have NL added. (Tomáš Janoušek) Solution: Only use b_no_eol_lnum when doing a binary write. (closes vim/vim#7535) https://github.com/vim/vim/commit/b3c8b1d25414f2e24ad03551cdf125b3e2c142b1
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index f28ee1bfcb..8e1be3bbf7 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -3318,7 +3318,7 @@ restore_backup:
if (end == 0
|| (lnum == end
&& (write_bin || !buf->b_p_fixeol)
- && (lnum == buf->b_no_eol_lnum
+ && ((write_bin && lnum == buf->b_no_eol_lnum)
|| (lnum == buf->b_ml.ml_line_count && !buf->b_p_eol)))) {
lnum++; // written the line, count it
no_eol = true;