From e579d38339578000755e13ecc7502bf7c4c5fc56 Mon Sep 17 00:00:00 2001 From: Chiel ten Brinke Date: Mon, 6 Feb 2017 10:30:59 +0100 Subject: [PATCH] Don't pass textwidth to yapf when it is 0. --- plugin/defaults.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/defaults.vim b/plugin/defaults.vim index abb4c61..01897f5 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -42,7 +42,7 @@ if !exists('g:formatter_yapf_style') let g:formatter_yapf_style = 'pep8' endif if !exists('g:formatdef_yapf') - let g:formatdef_yapf = "'yapf --style=\"{based_on_style:'.g:formatter_yapf_style.',indent_width:'.&shiftwidth.',column_limit:'.&textwidth.'}\" -l '.a:firstline.'-'.a:lastline" + let g:formatdef_yapf = "'yapf --style=\"{based_on_style:'.g:formatter_yapf_style.',indent_width:'.&shiftwidth.(&textwidth ? ',column_limit:'.&textwidth : '').'}\" -l '.a:firstline.'-'.a:lastline" endif if !exists('g:formatters_python')