forked from qt-creator/qt-creator
Line length for QML/JS editing automatic formatting
Adding parameters to functions in the QML/JS formatter Adding widget and setting to the QML/JS editing settings Fixes: QTCREATORBUG-23411 Change-Id: Ib9d3ac3b22443e81cd636fbc276c6544dab1511b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
#include <qmljs/qmljsreformatter.h>
|
||||
#include <qmljstools/qmljstoolsconstants.h>
|
||||
#include <qmljstools/qmljstoolssettings.h>
|
||||
#include <qmljstools/qmljscodestylepreferences.h>
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -274,7 +276,8 @@ void QmlJSEditorPluginPrivate::reformatFile()
|
||||
TextEditor::TabSettings tabSettings = m_currentDocument->tabSettings();
|
||||
const QString &newText = QmlJS::reformat(document,
|
||||
tabSettings.m_indentSize,
|
||||
tabSettings.m_tabSize);
|
||||
tabSettings.m_tabSize,
|
||||
QmlJSTools::QmlJSToolsSettings::globalCodeStyle()->currentCodeStyleSettings().lineLength);
|
||||
|
||||
// QTextDocument::setPlainText cannot be used, as it would reset undo/redo history
|
||||
const auto setNewText = [this, &newText]() {
|
||||
|
||||
Reference in New Issue
Block a user