当输入命令长度为1时,保证该符号为命令首字,避免过多的感知结果

pull/22/head
ChenX 7 years ago
parent 82ec176e33
commit d3dcf3cd97

@ -121,12 +121,13 @@ export class InputHint extends React.Component<InputHintProps, InputHitState>
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);
}

Loading…
Cancel
Save