提交 79a1f5a5 编写于 作者: R Rob Lourens

Break infinite loop in "focus previous result". Don't run focus next/previous at all when not valid

上级 02016869
......@@ -785,6 +785,10 @@ export class SearchView extends ViewPane {
}
selectNextMatch(): void {
if (!this.hasSearchResults()) {
return;
}
const [selected] = this.tree.getSelection();
// Expand the initial selected node, if needed
......@@ -824,6 +828,10 @@ export class SearchView extends ViewPane {
}
selectPreviousMatch(): void {
if (!this.hasSearchResults()) {
return;
}
const [selected] = this.tree.getSelection();
let navigator = this.tree.navigate(selected);
......@@ -831,7 +839,13 @@ export class SearchView extends ViewPane {
// Select previous until find a Match or a collapsed item
while (!prev || (!(prev instanceof Match) && !this.tree.isCollapsed(prev))) {
prev = prev ? navigator.previous() : navigator.last();
const nextPrev = prev ? navigator.previous() : navigator.last();
if (!prev && !nextPrev) {
return;
}
prev = nextPrev;
}
// Expand until last child is a Match
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册