forked from qt-creator/qt-creator
C++: Preserve original indentation in extract function
Also extend the refactoring changes to allow for reindenting. Task-number: QTCREATORBUG-6797 Change-Id: I515c9a37d9e62e1d5de52ff99bd492e739a81885 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "qmljsqtstylecodeformatter.h"
|
||||
#include "qmljstoolsconstants.h"
|
||||
#include "qmljsmodelmanager.h"
|
||||
#include "qmljsindenter.h"
|
||||
|
||||
#include <qmljs/parser/qmljsast_p.h>
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
@@ -77,6 +78,17 @@ public:
|
||||
} while (block.isValid() && block != end);
|
||||
}
|
||||
|
||||
virtual void reindentSelection(const QTextCursor &selection,
|
||||
const QString &fileName,
|
||||
const TextEditor::BaseTextEditorWidget *textEditor) const
|
||||
{
|
||||
const TextEditor::TabSettings &tabSettings =
|
||||
ProjectExplorer::actualTabSettings(fileName, textEditor);
|
||||
|
||||
QmlJSEditor::Internal::Indenter indenter;
|
||||
indenter.reindent(selection.document(), selection, tabSettings);
|
||||
}
|
||||
|
||||
virtual void fileChanged(const QString &fileName)
|
||||
{
|
||||
m_modelManager->updateSourceFiles(QStringList(fileName), true);
|
||||
|
||||
Reference in New Issue
Block a user