From d3dcf3cd972fc28ca4490da99606999847545fea Mon Sep 17 00:00:00 2001 From: ChenX Date: Wed, 28 Feb 2018 10:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E8=BE=93=E5=85=A5=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E4=B8=BA1=E6=97=B6,=E4=BF=9D=E8=AF=81?= =?UTF-8?q?=E8=AF=A5=E7=AC=A6=E5=8F=B7=E4=B8=BA=E5=91=BD=E4=BB=A4=E9=A6=96?= =?UTF-8?q?=E5=AD=97,=E9=81=BF=E5=85=8D=E8=BF=87=E5=A4=9A=E7=9A=84?= =?UTF-8?q?=E6=84=9F=E7=9F=A5=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UI/Components/commandLineInput/InputHint.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/UI/Components/commandLineInput/InputHint.tsx b/src/UI/Components/commandLineInput/InputHint.tsx index ff60ca72c..77f5db494 100644 --- a/src/UI/Components/commandLineInput/InputHint.tsx +++ b/src/UI/Components/commandLineInput/InputHint.tsx @@ -121,12 +121,13 @@ export class InputHint extends React.Component let intelliSenseCmdList: string[] = []; for (let cmdName of this.props.cmdList) { - if (cmdName.indexOf(inputCmd) !== -1) + if (inputCmd.length === 1) { - intelliSenseCmdList.push(cmdName); - continue; + if (cmdName.indexOf(inputCmd) === 0) + intelliSenseCmdList.push(cmdName); } - if (searchReg.test(cmdName)) + else if (cmdName.indexOf(inputCmd) !== -1 + || searchReg.test(cmdName)) { intelliSenseCmdList.push(cmdName); }