Commit feaa54b6 authored by Kåre Särs's avatar Kåre Särs

Fix goToPreviousMatch when file item above is not expanded.

parent ffaa27da
......@@ -1583,9 +1583,21 @@ void KatePluginSearchView::goToPreviousMatch()
}
}
QTreeWidgetItem *startChild = curr;
// go to the item above. (curr == null is not a problem)
curr = res->tree->itemAbove(curr);
// expand the items above if needed
if (curr && curr->data(0, ReplaceMatches::ColumnRole).toString().isEmpty()) {
res->tree->expandItem(curr); // probably this file item
curr = res->tree->itemAbove(curr);
if (curr && curr->data(0, ReplaceMatches::ColumnRole).toString().isEmpty()) {
res->tree->expandItem(curr); // probably file above if this is reached
}
curr = res->tree->itemAbove(startChild);
}
// skip file name items and the root item
while (curr && curr->data(0, ReplaceMatches::ColumnRole).toString().isEmpty()) {
curr = res->tree->itemAbove(curr);
......
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