|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import { Icon } from '@blueprintjs/core';
|
|
|
|
|
import { observer } from 'mobx-react';
|
|
|
|
|
import * as React from 'react';
|
|
|
|
|
import { end } from 'xaop';
|
|
|
|
@ -7,8 +8,8 @@ import { KeyWord } from '../../../Common/InputState';
|
|
|
|
|
import { KeyBoard } from '../../../Common/KeyEnum';
|
|
|
|
|
import { FixIndex, isLetter, isNum } from '../../../Common/Utils';
|
|
|
|
|
import { commandMachine } from '../../../Editor/CommandMachine';
|
|
|
|
|
import { CommandState } from '../../../Editor/CommandState';
|
|
|
|
|
import './InputHint.css';
|
|
|
|
|
import { Icon } from '@blueprintjs/core';
|
|
|
|
|
|
|
|
|
|
interface InputHintProps
|
|
|
|
|
{
|
|
|
|
@ -90,7 +91,7 @@ export class InputHint extends React.Component<InputHintProps, InputHitState>
|
|
|
|
|
let inputCmd = cmd.trim();
|
|
|
|
|
this.setState({ command: inputCmd });
|
|
|
|
|
//没有执行命令才会进行感知
|
|
|
|
|
if (commandMachine.m_CommandIng || this.state.isCNInput)
|
|
|
|
|
if (CommandState.CommandIng || this.state.isCNInput)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -159,7 +160,7 @@ export class InputHint extends React.Component<InputHintProps, InputHitState>
|
|
|
|
|
|
|
|
|
|
public handleCallback(cmd: string)
|
|
|
|
|
{
|
|
|
|
|
if (!commandMachine.m_CommandIng)
|
|
|
|
|
if (!CommandState.CommandIng)
|
|
|
|
|
{
|
|
|
|
|
if (commandMachine.isCommandExist(cmd))
|
|
|
|
|
{
|
|
|
|
@ -195,7 +196,7 @@ export class InputHint extends React.Component<InputHintProps, InputHitState>
|
|
|
|
|
let cmd = this.m_InputEl.value;
|
|
|
|
|
if (this.state.intelliSenseCommand.length > 0)
|
|
|
|
|
cmd = this.state.intelliSenseCommand[this.state.intelliSenseIndex];
|
|
|
|
|
else if (cmd === "" && !commandMachine.m_CommandIng)
|
|
|
|
|
else if (cmd === "" && !CommandState.CommandIng)
|
|
|
|
|
cmd = this.props.historyCmdList[this.props.historyCmdList.length - 1]
|
|
|
|
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
@ -228,7 +229,7 @@ export class InputHint extends React.Component<InputHintProps, InputHitState>
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//历史命令
|
|
|
|
|
if (!commandMachine.m_CommandIng && this.props.historyCmdList.length > 0)
|
|
|
|
|
if (!CommandState.CommandIng && this.props.historyCmdList.length > 0)
|
|
|
|
|
{
|
|
|
|
|
if (e.keyCode == KeyBoard.ArrowUp)
|
|
|
|
|
{
|
|
|
|
|