mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 11:41:04 +00:00
feat(cli): allow executing commands on perfect match (#4397)
Co-authored-by: Jenna Inouye <jinouye@google.com>
This commit is contained in:
parent
8497176168
commit
de27ea6095
4 changed files with 51 additions and 18 deletions
|
|
@ -162,7 +162,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
|||
// - Otherwise, the base is everything EXCEPT the last partial part.
|
||||
const basePath =
|
||||
hasTrailingSpace || isParentPath ? parts : parts.slice(0, -1);
|
||||
const newValue = `/${[...basePath, suggestion].join(' ')} `;
|
||||
const newValue = `/${[...basePath, suggestion].join(' ')}`;
|
||||
|
||||
buffer.setText(newValue);
|
||||
} else {
|
||||
|
|
@ -266,6 +266,12 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
|||
return;
|
||||
}
|
||||
|
||||
// If the command is a perfect match, pressing enter should execute it.
|
||||
if (completion.isPerfectMatch && key.name === 'return') {
|
||||
handleSubmitAndClear(buffer.text);
|
||||
return;
|
||||
}
|
||||
|
||||
if (completion.showSuggestions) {
|
||||
if (completion.suggestions.length > 1) {
|
||||
if (key.name === 'up') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue