Commit e31d729c authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

LocHistory: When limiting size, also rewind currentLocation

parent 615c62a7
Pipeline #70604 passed with stage
in 5 minutes and 56 seconds
......@@ -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