Commit 40eab898 authored by con's avatar con
Browse files

Last 'finish' of this iteration of navigation history.

Task:     240811
parent 37973823
......@@ -1358,7 +1358,7 @@ QList<IEditor*> EditorManager::editorHistory() const
return m_d->m_editorHistory;
}
void EditorManager::addCurrentPositionToNavigationHistory(const QByteArray &saveState)
void EditorManager::addCurrentPositionToNavigationHistory(const QByteArray &saveState, bool compress)
{
IEditor *editor = currentEditor();
if (!editor)
......@@ -1367,14 +1367,11 @@ void EditorManager::addCurrentPositionToNavigationHistory(const QByteArray &save
return;
QString fileName = editor->file()->fileName();
bool compress;
QByteArray state;
if (saveState.isNull()) {
state = editor->saveState();
compress = false;
} else {
state = saveState;
compress = true;
}
// cut existing
int firstIndexToRemove;
......
......@@ -132,7 +132,7 @@ public:
QList<IEditor*> editorsForFiles(QList<IFile*> files) const;
//QList<EditorGroup *> editorGroups() const;
QList<IEditor*> editorHistory() const;
void addCurrentPositionToNavigationHistory(const QByteArray &saveState = QByteArray());
void addCurrentPositionToNavigationHistory(const QByteArray &saveState = QByteArray(), bool compress = false);
bool saveEditor(IEditor *editor);
......
......@@ -961,6 +961,7 @@ void BaseTextEditor::setTextCursor(const QTextCursor &cursor)
void BaseTextEditor::gotoLine(int line, int column)
{
d->m_lastCursorChangeWasInteresting = false; // avoid adding the previous position to history
const int blockNumber = line - 1;
const QTextBlock &block = document()->findBlockByNumber(blockNumber);
if (block.isValid()) {
......
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