forked from qt-creator/qt-creator
Beautifier: added support for fallback-style option for clang-format
Task-number: QTCREATORBUG-17813 Change-Id: I36adee4889d1b851171d34852eed29639c68b574 Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -137,7 +137,14 @@ Command ClangFormat::command() const
|
||||
command.setProcessing(Command::PipeProcessing);
|
||||
|
||||
if (m_settings->usePredefinedStyle()) {
|
||||
command.addOption("-style=" + m_settings->predefinedStyle());
|
||||
const QString predefinedStyle = m_settings->predefinedStyle();
|
||||
command.addOption("-style=" + predefinedStyle);
|
||||
if (predefinedStyle == "File") {
|
||||
const QString fallbackStyle = m_settings->fallbackStyle();
|
||||
if (fallbackStyle != "Default")
|
||||
command.addOption("-fallback-style=" + fallbackStyle);
|
||||
}
|
||||
|
||||
command.addOption("-assume-filename=%file");
|
||||
} else {
|
||||
command.addOption("-style=file");
|
||||
|
||||
Reference in New Issue
Block a user