diff options
author | Johan Klokkhammer Helsing <johanhelsing@gmail.com> | 2015-10-08 20:17:25 +0200 |
---|---|---|
committer | Johan Klokkhammer Helsing <johanhelsing@gmail.com> | 2015-11-22 20:03:41 +0100 |
commit | a86d4b323e2f5ee9fec791ca1dcce7a608de575d (patch) | |
tree | 21996ffb28447451e04977703a434767cf437ec3 /src/nvim/fileio.c | |
parent | 1fbb56795d16783f9a97e25e3b71ab3ac2a644dc (diff) | |
download | rneovim-a86d4b323e2f5ee9fec791ca1dcce7a608de575d.tar.gz rneovim-a86d4b323e2f5ee9fec791ca1dcce7a608de575d.tar.bz2 rneovim-a86d4b323e2f5ee9fec791ca1dcce7a608de575d.zip |
vim-patch:7.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)
https://github.com/vim/vim/commit/34d72d4b6c1a2b04a214d8a49b7d22c97bc7a8bc
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index a7472b40e2..75eb89045d 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -1934,10 +1934,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; @@ -3322,7 +3322,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 */ |