From 47a36765df47ff4b77a760b5f67938d0568e9a8d Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 10 Sep 2014 17:07:32 +0200 Subject: [PATCH] TextEditor: Prevent overwriting of completion settings This was a regression introduced during the editor setup refactoring. Task-number: QTCREATORBUG-12982 Change-Id: I7b26b4105dfb50357dd2cf97d07153031d0b2dc0 Reviewed-by: Campbell Barton Reviewed-by: hjk --- src/plugins/texteditor/basetexteditor.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 621cd818762..c90aeb64817 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -7282,14 +7282,16 @@ BaseTextEditor *BaseTextEditorFactory::createEditorHelper(const BaseTextDocument editor->d->m_origin = this; editor->m_widget = widget; + + // Needs to go before setTextDocument as this copies the current settings. + if (m_autoCompleterCreator) + widget->setAutoCompleter(m_autoCompleterCreator()); + widget->setTextDocument(document); widget->d->m_codeAssistant.configure(widget); widget->d->m_commentDefinition.setStyle(m_commentStyle); - if (m_autoCompleterCreator) - widget->setAutoCompleter(m_autoCompleterCreator()); - connect(widget, &BaseTextEditorWidget::markRequested, editor, [editor](int line, BaseTextEditor::MarkRequestKind kind) { editor->markRequested(editor, line, kind);