From 546e181dab80131aa3aacaefb43063864a55122e Mon Sep 17 00:00:00 2001 From: Chiel92 Date: Fri, 8 Feb 2013 20:58:43 +0100 Subject: [PATCH] formatprg only set when b:formatprg exists --- plugin/autoformat.vim | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugin/autoformat.vim b/plugin/autoformat.vim index b011239..d989f20 100644 --- a/plugin/autoformat.vim +++ b/plugin/autoformat.vim @@ -34,8 +34,6 @@ function! g:FindFormatter(name, args) endfunction "formatprg is a global option -"So when buffer/window/tab changes, (re)load formatprg from the bufferlocal -"variable -au BufEnter,WinEnter * let &formatprg=b:formatprg -"Default value for b:formatprg is empty string -let b:formatprg = "" +"So when buffer/window/tab changes, +"(re)load formatprg from the bufferlocal variable +au BufEnter,WinEnter * if exists("b:formatprg") | let &formatprg=b:formatprg