]> git.phdru.name Git - dotfiles.git/commitdiff
.vimrc: Protect SetupEncoding from reloading unnamed buffer
authorOleg Broytman <phd@phdru.name>
Fri, 25 Aug 2017 09:53:04 +0000 (12:53 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 25 Aug 2017 09:53:04 +0000 (12:53 +0300)
.vimrc

diff --git a/.vimrc b/.vimrc
index 470a8007fe54115fb94e4006a4d2e7b2a59abc32..d743be717f83686b9ed92935f7260d87224116f9 100644 (file)
--- 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