提交 e2d234e6 编写于 作者: J Johannes Rieken

make sure to return at least the empty string when Enter was hit and input is valid, fixes #2631

上级 c697e762
......@@ -186,8 +186,8 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
let currentPick = defaultMessage;
let currentValidation = TPromise.as(true);
let inputDecoration: Severity;
let lastValue = options && options.value;
let currentDecoration: Severity;
let lastValue = options && options.value || '';
const init = (resolve: (value: IPickOpenEntry | TPromise<IPickOpenEntry>) => any, reject: (value: any) => any) => {
......@@ -199,7 +199,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
password: options.password,
placeHolder: options.placeHolder,
value: options.value,
inputDecoration: inputDecoration,
inputDecoration: currentDecoration,
onDidType: (value) => {
lastValue = value;
......@@ -209,7 +209,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
}
currentValidation = TPromise.timeout(100).then(() => {
return options.validateInput(value).then(message => {
inputDecoration = !!message ? Severity.Error : void 0;
currentDecoration = !!message ? Severity.Error : void 0;
let newPick = message || defaultMessage;
if (newPick !== currentPick) {
currentPick = newPick;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册