r'|protodevel|java)',
help='custom pattern selecting file paths to reformat '
'(case insensitive, overridden by -regex)')
+ parser.add_argument('-sort-includes', action='store_true', default=False,
+ help='let clang-format sort include blocks')
parser.add_argument('-v', '--verbose', action='store_true',
help='be more verbose, ineffective without -i')
parser.add_argument(
command = [binary, filename]
if args.i:
command.append('-i')
+ if args.sort_includes:
+ command.append('-sort-includes')
command.extend(lines)
if args.style:
command.extend(['-style', args.style])
if encoding == 'Undefined':
encoding = 'utf-8'
regions = []
- command = [binary, '-style', style]
+ command = [binary, '-sort-includes', '-style', style]
for region in self.view.sel():
regions.append(region)
region_offset = min(region.a, region.b)
nil `(,temp-buffer ,temp-file) nil
"-output-replacements-xml"
+ "-sort-includes"
"-assume-filename" (or (buffer-file-name) "")
"-style" style
"-offset" (number-to-string start)