From: Oleg Broytman Date: Fri, 25 Aug 2017 09:53:04 +0000 (+0300) Subject: .vimrc: Protect SetupEncoding from reloading unnamed buffer X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=85887d410140eb8dd603b20a5fe006fc79f30530;p=dotfiles.git .vimrc: Protect SetupEncoding from reloading unnamed buffer --- diff --git a/.vimrc b/.vimrc index 470a800..d743be7 100644 --- a/.vimrc +++ b/.vimrc @@ -343,7 +343,9 @@ function! SetupEncoding(encoding) call RestorePosition() let b:encoding_set = 1 - execute "edit ++enc=" . a:encoding + if len(expand('%')) + execute "edit ++enc=" . a:encoding + endif endfunction