Format with predefined_style when a style cannot be obtained

This commit is contained in:
Daniel Martín 2018-01-03 21:48:10 +01:00 committed by Jacob Dufault
parent 5f8e1935a6
commit 7e2c19d792

View File

@ -44,7 +44,7 @@ std::vector<tooling::Replacement> ClangFormatDocument(
}
auto format_result = reformat(
*style, working_file->buffer_content,
style ? *style : predefined_style, working_file->buffer_content,
llvm::ArrayRef<tooling::Range>(tooling::Range(start, end - start)),
working_file->filename);
return std::vector<tooling::Replacement>(format_result.begin(),