提交 ed1ae06b 编写于 作者: M mgquan@myseneca.ca

updates

上级 402e8ea2
......@@ -46,16 +46,12 @@ export abstract class SimpleFindWidget extends Widget {
label: NLS_FIND_INPUT_LABEL,
placeholder: NLS_FIND_INPUT_PLACEHOLDER,
validation: (value: string): InputBoxMessage | null => {
if (value.length === 0) {
return null;
}
if (!this._findInput.getRegex()) {
if (value.length === 0 || !this._findInput.getRegex()) {
return null;
}
try {
/* tslint:disable:no-unused-expression */
/* tslint:disable-next-line:no-unused-expression */
new RegExp(value);
/* tslint:enable:no-unused-expression */
return null;
} catch (e) {
return { content: e.message };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册