From 7e2c19d79242b412cda0d6eb03aafa19ef499a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Wed, 3 Jan 2018 21:48:10 +0100 Subject: [PATCH] Format with predefined_style when a style cannot be obtained --- src/clang_format.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clang_format.cc b/src/clang_format.cc index 5fa1410c..82a74ead 100644 --- a/src/clang_format.cc +++ b/src/clang_format.cc @@ -44,7 +44,7 @@ std::vector ClangFormatDocument( } auto format_result = reformat( - *style, working_file->buffer_content, + style ? *style : predefined_style, working_file->buffer_content, llvm::ArrayRef(tooling::Range(start, end - start)), working_file->filename); return std::vector(format_result.begin(),