Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp
- index 79eee4a..66eb906 100644
- --- a/src/plugins/beautifier/clangformat/clangformat.cpp
- +++ b/src/plugins/beautifier/clangformat/clangformat.cpp
- @@ -52,6 +52,7 @@
- #include <QAction>
- #include <QMenu>
- +#include <QRegularExpression>
- namespace Beautifier {
- namespace Internal {
- @@ -136,9 +137,14 @@ Command ClangFormat::command(int offset, int length) const
- if (m_settings->usePredefinedStyle()) {
- command.addOption(QLatin1String("-style=") + m_settings->predefinedStyle());
- } else {
- - command.addOption(QLatin1String("-style={")
- - + m_settings->style(m_settings->customStyle()).remove(QLatin1Char('\n'))
- - + QLatin1Char('}'));
- + QString customStyle = m_settings->style(m_settings->customStyle());
- + customStyle = customStyle.replace(QRegularExpression(QString::fromLatin1("\n+")), QString::fromLatin1(","));
- + if(customStyle.endsWith(QString::fromLatin1(",")))
- + customStyle.chop(1);
- + if(customStyle.startsWith(QString::fromLatin1(",")))
- + customStyle.remove(0, 1);
- +
- + command.addOption(QLatin1String("-style={") + customStyle + QLatin1Char('}'));
- }
- if (offset != -1) {
Add Comment
Please, Sign In to add comment