Commit cc04261e authored by Daniel Teske's avatar Daniel Teske

Fix BaseTextmark lineNumber tracking

The following sequence would add the BaseTextmark to the wrong line:
1) Add a mark on line x
2) Move line x down by addign newlines above
3) Close and reopen the file
=> Mark would be readded to line x

Change-Id: Ia5d580b5893331974fb908e367b74df69fbb6572
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent 5e27104f
......@@ -62,6 +62,7 @@ void Bookmark::updateLineNumber(int lineNumber)
m_lineNumber = lineNumber;
m_manager->updateBookmark(this);
}
BaseTextMark::updateLineNumber(lineNumber);
}
void Bookmark::updateBlock(const QTextBlock &block)
......
......@@ -68,6 +68,7 @@ void BreakpointMarker::removedFromEditor()
void BreakpointMarker::updateLineNumber(int lineNumber)
{
breakHandler()->updateLineNumberFromMarker(m_id, lineNumber);
BaseTextMark::updateLineNumber(lineNumber);
}
} // namespace Internal
......
......@@ -56,6 +56,7 @@ private:
void TaskMark::updateLineNumber(int lineNumber)
{
ProjectExplorerPlugin::instance()->taskHub()->updateTaskLineNumber(m_id, lineNumber);
BaseTextMark::updateLineNumber(lineNumber);
}
void TaskMark::removedFromEditor()
......
......@@ -128,6 +128,11 @@ BaseTextMark::~BaseTextMark()
Internal::TextEditorPlugin::instance()->baseTextMarkRegistry()->remove(this);
}
void BaseTextMark::updateLineNumber(int lineNumber)
{
m_line = lineNumber;
}
void BaseTextMark::updateMarker()
{
if (m_markableInterface)
......
......@@ -61,6 +61,8 @@ public:
BaseTextMark(const QString &fileName, int lineNumber);
virtual ~BaseTextMark();
void updateLineNumber(int lineNumber);
// call this if the icon has changed.
void updateMarker();
......
Markdown is supported
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