Support custom line lengths with yapf Python formatter.

The 'column-width' option was added to the default yapf command. The
value is set to match the 'textwidth' value of the current buffer.
This commit is contained in:
Casey McGinty 2016-12-03 18:53:48 -08:00
parent 1ad6f8eea7
commit 5c957257e0

View File

@ -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.'}\" -l '.a:firstline.'-'.a:lastline"
let g:formatdef_yapf = "'yapf --style=\"{based_on_style:'.g:formatter_yapf_style.',indent_width:'.&shiftwidth.',column_limit:'.&textwidth.'}\" -l '.a:firstline.'-'.a:lastline"
endif
if !exists('g:formatters_python')