forked from qt-creator/qt-creator
ClangFormat: Add disable option
- Added a possibility to disable ClangFormat plugin - Removed unneeded properties from clangformatsettings Change-Id: If71f46670e4fd3d2dac6d18c97df5a811504ed5e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "clangformatconfigwidget.h"
|
||||
#include "clangformatconstants.h"
|
||||
#include "clangformatindenter.h"
|
||||
#include "clangformatsettings.h"
|
||||
#include "clangformatutils.h"
|
||||
#include "tests/clangformat-test.h"
|
||||
|
||||
@@ -56,6 +57,7 @@
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <texteditor/icodestylepreferences.h>
|
||||
#include <texteditor/textindenter.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
|
||||
#include <clang/Format/Format.h>
|
||||
@@ -81,6 +83,8 @@ class ClangFormatStyleFactory : public CppEditor::CppCodeStylePreferencesFactory
|
||||
public:
|
||||
TextEditor::Indenter *createIndenter(QTextDocument *doc) const override
|
||||
{
|
||||
if (ClangFormatSettings::instance().mode() == ClangFormatSettings::Disable)
|
||||
return CppEditor::CppCodeStylePreferencesFactory::createIndenter(doc);
|
||||
return new ClangFormatIndenter(doc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user