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 #7535)
This commit is contained in:
Bram Moolenaar
2020-12-23 18:54:57 +01:00
parent 23999d799c
commit b3c8b1d254
3 changed files with 21 additions and 1 deletions

View File

@ -2031,7 +2031,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))))
{