From e80935baff4221c34af0c9f200f9b48404dacdfa Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Thu, 27 Jul 2017 10:51:23 -0400 Subject: [PATCH] fixup! defaults/yapf: handle yapf config file --- plugin/defaults.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/defaults.vim b/plugin/defaults.vim index 561a658..20f4266 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -43,7 +43,7 @@ if !exists('g:formatter_yapf_style') endif if !exists('g:formatdef_yapf') let s:configfile_def = "'yapf -l '.a:firstline.'-'.a:lastline" - let s:noconfigfile_def = "'yapf --style=\"{based_on_style:'.g:formatter_yapf_style.',indent_width:'.&shiftwidth.'}\" -l '.a:firstline.'-'.a:lastline" + let s:noconfigfile_def = "'yapf --style=\"{based_on_style:'.g:formatter_yapf_style.',indent_width:'.&shiftwidth.(&textwidth ? ',column_limit:'.&textwidth : '').'}\" -l '.a:firstline.'-'.a:lastline" let g:formatdef_yapf = "g:YAPFFormatConfigFileExists() ? (" . s:configfile_def . ") : (" . s:noconfigfile_def . ")" endif