From 63e8b9075b3a1d502cdcbb63cb2b19e0e6208263 Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Wed, 14 Sep 2011 16:22:45 +0200 Subject: [PATCH] Code assist: Fix doxygen completion When the assist interface is detached the correct thing to do is to clone the document, not simply to copy the text content. Then data like the user state is preserved. For the particular issue below, the problem is that the simple lexer doesn't have the correct initial state and thus cannot identify its inside a comment. Task-number: QTCREATORBUG-6061 Change-Id: I59380eeb229e322bafb1e799d649df90327c0f54 Reviewed-on: http://codereview.qt-project.org/4912 Reviewed-by: Qt Sanity Bot Reviewed-by: Christian Kamm --- src/plugins/texteditor/codeassist/defaultassistinterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/codeassist/defaultassistinterface.cpp b/src/plugins/texteditor/codeassist/defaultassistinterface.cpp index 1bd9f46a50..84a5ecad1a 100644 --- a/src/plugins/texteditor/codeassist/defaultassistinterface.cpp +++ b/src/plugins/texteditor/codeassist/defaultassistinterface.cpp @@ -69,7 +69,7 @@ QString DefaultAssistInterface::textAt(int pos, int length) const void DefaultAssistInterface::detach(QThread *destination) { - m_document = new QTextDocument(m_document->toPlainText()); + m_document = m_document->clone(); m_document->moveToThread(destination); m_detached = true; } -- 2.11.0