fix #9854
This commit is contained in:
parent
5e207a1dd7
commit
20c76bbd21
|
@ -408,7 +408,7 @@ export class SearchViewlet extends Viewlet {
|
|||
this.toUnbind.push(renderer);
|
||||
|
||||
this.toUnbind.push(this.tree.addListener2('selection', (event: any) => {
|
||||
let element: Match;
|
||||
let element: any;
|
||||
let keyboard = event.payload && event.payload.origin === 'keyboard';
|
||||
if (keyboard) {
|
||||
element = this.tree.getFocus();
|
||||
|
@ -426,12 +426,15 @@ export class SearchViewlet extends Viewlet {
|
|||
let sideBySide = (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey));
|
||||
let focusEditor = (keyboard && (<KeyboardEvent>originalEvent).keyCode === KeyCode.Enter) || doubleClick;
|
||||
|
||||
if (this.currentSelectedFileMatch) {
|
||||
this.currentSelectedFileMatch.setSelectedMatch(null);
|
||||
if (element instanceof Match) {
|
||||
let selectedMatch:Match = element;
|
||||
if (this.currentSelectedFileMatch) {
|
||||
this.currentSelectedFileMatch.setSelectedMatch(null);
|
||||
}
|
||||
this.currentSelectedFileMatch = selectedMatch.parent();
|
||||
this.currentSelectedFileMatch.setSelectedMatch(selectedMatch);
|
||||
this.onFocus(selectedMatch, !focusEditor, sideBySide, doubleClick);
|
||||
}
|
||||
this.currentSelectedFileMatch = element.parent();
|
||||
this.currentSelectedFileMatch.setSelectedMatch(element);
|
||||
this.onFocus(element, !focusEditor, sideBySide, doubleClick);
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
@ -902,7 +905,7 @@ export class SearchViewlet extends Viewlet {
|
|||
this.currentSelectedFileMatch = null;
|
||||
}
|
||||
|
||||
private onFocus(lineMatch: Match, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): TPromise<any> {
|
||||
private onFocus(lineMatch: any, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): TPromise<any> {
|
||||
if (!(lineMatch instanceof Match)) {
|
||||
return TPromise.as(true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue