提交 b1d9a055 编写于 作者: B Benjamin Pasero

Quick open widget doesn't acknowledge tree.reveal(...) as a promise

上级 f38e086b
......@@ -343,7 +343,7 @@ export class QuickOpenWidget implements IModelProvider {
// Reveal
focus = this.tree.getFocus();
if (focus) {
revealToTop ? this.tree.reveal(focus, 0) : this.tree.reveal(focus);
revealToTop ? this.tree.reveal(focus, 0).done(null, errors.onUnexpectedError) : this.tree.reveal(focus).done(null, errors.onUnexpectedError);
}
}
......@@ -543,7 +543,7 @@ export class QuickOpenWidget implements IModelProvider {
let entryToFocus = caseSensitiveMatch || caseInsensitiveMatch;
if (entryToFocus) {
this.tree.setFocus(entryToFocus);
this.tree.reveal(entryToFocus, 0);
this.tree.reveal(entryToFocus, 0).done(null, errors.onUnexpectedError);
return;
}
......@@ -552,14 +552,14 @@ export class QuickOpenWidget implements IModelProvider {
// Second check for auto focus of first entry
if (autoFocus.autoFocusFirstEntry) {
this.tree.focusFirst();
this.tree.reveal(this.tree.getFocus(), 0);
this.tree.reveal(this.tree.getFocus(), 0).done(null, errors.onUnexpectedError);
}
// Third check for specific index option
else if (typeof autoFocus.autoFocusIndex === 'number') {
if (entries.length > autoFocus.autoFocusIndex) {
this.tree.focusNth(autoFocus.autoFocusIndex);
this.tree.reveal(this.tree.getFocus());
this.tree.reveal(this.tree.getFocus()).done(null, errors.onUnexpectedError);
}
}
......
......@@ -7,6 +7,7 @@
import nls = require('vs/nls');
import {Promise, TPromise} from 'vs/base/common/winjs.base';
import DOM = require('vs/base/browser/dom');
import errors = require('vs/base/common/errors');
import {IEventEmitter} from 'vs/base/common/eventEmitter';
import {Registry} from 'vs/platform/platform';
import {Dimension, Builder, $} from 'vs/base/browser/builder';
......@@ -283,7 +284,7 @@ export abstract class ViewerViewlet extends Viewlet {
// Make sure the current selected element is revealed
let selection = this.viewer.getSelection();
if (selection.length > 0) {
this.reveal(selection[0], 0.5);
this.reveal(selection[0], 0.5).done(null, errors.onUnexpectedError);
}
// Pass Focus to Viewer
......
......@@ -14,6 +14,7 @@ import workbenchEditorCommon = require('vs/workbench/common/editor');
import {CollapsibleState} from 'vs/base/browser/ui/splitview/splitview';
import {IWorkingFileEntry, IWorkingFilesModel, IWorkingFileModelChangeEvent, LocalFileChangeEvent, EventType as FileEventType, IFilesConfiguration, ITextFileService} from 'vs/workbench/parts/files/common/files';
import dom = require('vs/base/browser/dom');
import errors = require('vs/base/common/errors');
import {EditorEvent, EventType as WorkbenchEventType, UntitledEditorEvent} from 'vs/workbench/browser/events';
import {AdaptiveCollapsibleViewletView} from 'vs/workbench/browser/viewlet';
import {CloseWorkingFileAction, SaveAllAction} from 'vs/workbench/parts/files/browser/fileActions';
......@@ -275,7 +276,7 @@ export class WorkingFilesView extends AdaptiveCollapsibleViewletView {
if (entry) {
this.tree.setFocus(entry);
this.tree.setSelection([entry]);
this.tree.reveal(entry);
this.tree.reveal(entry).done(null, errors.onUnexpectedError);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册