Merge pull request #3144 from jamescdavis/dont_append_newline_when_noeol

don't append a newline to temp file when buffer is noeol and nofixeol is set
This commit is contained in:
w0rp
2020-08-14 00:32:28 +01:00
committed by GitHub
2 changed files with 50 additions and 1 deletions

View File

@@ -423,7 +423,10 @@ function! ale#util#Writefile(buffer, lines, filename) abort
\ ? map(copy(a:lines), 'substitute(v:val, ''\r*$'', ''\r'', '''')')
\ : a:lines
call writefile(l:corrected_lines, a:filename, 'S') " no-custom-checks
" Set binary flag if buffer doesn't have eol and nofixeol to avoid appending newline
let l:flags = !getbufvar(a:buffer, '&eol') && exists('+fixeol') && !&fixeol ? 'bS' : 'S'
call writefile(l:corrected_lines, a:filename, l:flags) " no-custom-checks
endfunction
if !exists('s:patial_timers')