Permalink
Browse files

apply fenc setting before writing diff file

  • Loading branch information...
1 parent b3c38dd commit c28e61b9ae9df248bfacf9864cf4e3d15e391bb4 @chrisbra committed Sep 20, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 autoload/histwin.vim
View
@@ -425,7 +425,9 @@ fun! s:DiffUndoBranch()"{{{1
if empty(prevchangenr)
return ''
endif
- let cur_ft = &ft
+ let cur_ft = &ft
+ let cur_fenc = &fenc
+ let cur_bom = &bomb
let buffer=getline(1,'$')
try
exe ':u ' . prevchangenr
@@ -437,7 +439,7 @@ fun! s:DiffUndoBranch()"{{{1
exe ':botright vsp '.tempname()
call setline(1, bufname(s:orig_buffer) . ' undo-branch: ' . change)
call append('$',buffer)
- exe "setl ft=".cur_ft
+ exe "setl ft=".cur_ft "fenc=".cur_fenc.(cur_bom ? " bomb" : " nobomb")
silent w!
diffthis
" Fix issue 2 for histwin: http://github.com/chrisbra/histwin/issues/2
@@ -1072,4 +1074,4 @@ endfun
" Modeline and Finish stuff: {{{1
let &cpo=s:cpo
unlet s:cpo
-" vim: ts=4 sts=4 fdm=marker com+=l\:\" fdl=0
+" vim: ts=4 sts=4 fdm=marker com+=l\:\" fdl=0:noet

0 comments on commit c28e61b

Please sign in to comment.