mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-02 01:23:30 +08:00
fix: don't append newline when buffer is noeol and nofixeol
This commit is contained in:
@@ -418,7 +418,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')
|
||||
|
||||
Reference in New Issue
Block a user