From 85887d410140eb8dd603b20a5fe006fc79f30530 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 25 Aug 2017 12:53:04 +0300 Subject: [PATCH] .vimrc: Protect SetupEncoding from reloading unnamed buffer --- .vimrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.39.5