mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 03:53:47 -05:00
Move look-up out of loop.
This commit is contained in:
@@ -334,8 +334,9 @@ function! s:write_buffer(bufnr, file)
|
|||||||
if getbufvar(a:bufnr, '&fileformat') ==# 'dos'
|
if getbufvar(a:bufnr, '&fileformat') ==# 'dos'
|
||||||
call map(bufcontents, 'v:val."\r"')
|
call map(bufcontents, 'v:val."\r"')
|
||||||
endif
|
endif
|
||||||
if getbufvar(a:bufnr, '&fileencoding') !=# &encoding
|
let fenc = getbufvar(a:bufnr, '&fileencoding')
|
||||||
call map(bufcontents, 'iconv(v:val, &encoding, getbufvar(a:bufnr, "&fileencoding"))')
|
if fenc !=# &encoding
|
||||||
|
call map(bufcontents, 'iconv(v:val, &encoding, "'.fenc.'")')
|
||||||
endif
|
endif
|
||||||
call writefile(bufcontents, a:file)
|
call writefile(bufcontents, a:file)
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user