forked from qt-creator/qt-creator
QmlJSEditor: refines textmarker logic
The textmarker is now updated when the document gets updated and the textmarker is shown again, if the user closes the QuickToolBar.
This commit is contained in:
@@ -711,8 +711,12 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
|
||||
|
||||
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<ModelManagerInterface>();
|
||||
m_contextPane = ExtensionSystem::PluginManager::instance()->getObject<QmlJS::IContextPane>();
|
||||
if (m_contextPane)
|
||||
|
||||
|
||||
if (m_contextPane) {
|
||||
connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(onCursorPositionChanged()));
|
||||
connect(m_contextPane, SIGNAL(closed()), this, SLOT(showTextMarker()));
|
||||
}
|
||||
m_oldCursorPosition = -1;
|
||||
|
||||
if (m_modelManager) {
|
||||
@@ -975,11 +979,20 @@ void QmlJSTextEditor::updateCursorPositionNow()
|
||||
}
|
||||
}
|
||||
setRefactorMarkers(markers);
|
||||
} else {
|
||||
QList<TextEditor::Internal::RefactorMarker> markers;
|
||||
setRefactorMarkers(markers);
|
||||
}
|
||||
m_oldCursorPosition = position();
|
||||
}
|
||||
}
|
||||
|
||||
void QmlJSTextEditor::showTextMarker()
|
||||
{
|
||||
m_oldCursorPosition = -1;
|
||||
updateCursorPositionNow();
|
||||
}
|
||||
|
||||
void QmlJSTextEditor::updateUses()
|
||||
{
|
||||
m_updateUsesTimer->start();
|
||||
@@ -1695,6 +1708,7 @@ void QmlJSTextEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
||||
Node *newNode = m_semanticInfo.declaringMemberNoProperties(position());
|
||||
if (newNode) {
|
||||
m_contextPane->apply(editableInterface(), doc, m_semanticInfo.snapshot, newNode, true);
|
||||
showTextMarker();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -244,6 +244,7 @@ private slots:
|
||||
void updateOutlineNow();
|
||||
void updateOutlineIndexNow();
|
||||
void updateCursorPositionNow();
|
||||
void showTextMarker();
|
||||
void updateFileName();
|
||||
|
||||
void updateUses();
|
||||
|
Reference in New Issue
Block a user