Commit 0919ddef authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

LocHistory: When limiting size, also rewind currentLocation


(cherry picked from commit e31d729c)
parent e7241670
......@@ -539,8 +539,10 @@ void KateViewSpace::addPositionToHistory(const QUrl &url, KTextEditor::Cursor c,
}
// limit size to 50, remove first 10
if (m_locations.size() >= 50) {
m_locations.erase(m_locations.begin(), m_locations.begin() + 10);
int toErase = (int)m_locations.size() - 50;
if (toErase > 0) {
m_locations.erase(m_locations.begin(), m_locations.begin() + toErase);
currentLocation -= toErase;
}
}
int KateViewSpace::hiddenDocuments() const
......
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