TextEditor: update codeStyle after setting language id

This updates the tab settings to the correct one for the specific
language like C++ or QML. Only observable if the file is not part of a
project. Otherwise the project code style settings will set the language
specific tab settings.

Fixes: QTCREATORBUG-25485
Change-Id: I736646557a213369903fe495e3b5a3a950141961
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2021-03-16 11:30:15 +01:00
parent 9b1f4f7c29
commit d187022892

View File

@@ -6010,6 +6010,7 @@ void TextEditorWidgetPrivate::toggleBlockVisible(const QTextBlock &block)
void TextEditorWidget::setLanguageSettingsId(Id settingsId) void TextEditorWidget::setLanguageSettingsId(Id settingsId)
{ {
d->m_tabSettingsId = settingsId; d->m_tabSettingsId = settingsId;
setCodeStyle(TextEditorSettings::codeStyle(settingsId));
} }
Id TextEditorWidget::languageSettingsId() const Id TextEditorWidget::languageSettingsId() const