From d9d3d86ad27a573804bef57745bbc917256c28f7 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Tue, 10 May 2016 14:17:52 +0200 Subject: [PATCH] Beautifier: Fix clang-format file style regression Commit 3310fbc8f2f00aacf4f3c3bb373f49b1549db8bd introduced regression replacing -assume-filename=%file with -assume-filename=%filename, that caused only file name part to be passed to clang-format, not whole path to the buffer. Effectively when formatting the buffer with style set to "File", clang-format was unable to determine related style file placement (eg. within the project tree) anymore. This reverts back to use %file, not %filename, making clang-format "File" style work again as expected. Change-Id: I5e7ae3d1186b1e7c33dc89a7d60aacc0f0671e51 Reviewed-by: Lorenz Haas Reviewed-by: Orgad Shaneh --- src/plugins/beautifier/clangformat/clangformat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index 0e77d2c2918..f677bde9e4f 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -132,7 +132,7 @@ Command ClangFormat::command(int offset, int length) const if (m_settings->usePredefinedStyle()) { command.addOption(QLatin1String("-style=") + m_settings->predefinedStyle()); - command.addOption(QLatin1String("-assume-filename=%filename")); + command.addOption(QLatin1String("-assume-filename=%file")); } else { command.addOption(QLatin1String("-style=file")); const QString path =