Commit abdda359 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

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.
parent 2c160a9b
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment