This commit is contained in:
parent
761ffc6338
commit
6aac93ee07
|
@ -95,7 +95,9 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
|||
const inputHistory = useInputHistory({
|
||||
userMessages,
|
||||
onSubmit: handleSubmitAndClear,
|
||||
isActive: !completion.showSuggestions && !shellModeActive,
|
||||
isActive:
|
||||
(!completion.showSuggestions || completion.suggestions.length === 1) &&
|
||||
!shellModeActive,
|
||||
currentQuery: buffer.text,
|
||||
onChange: customSetTextAndResetCompletionSignal,
|
||||
});
|
||||
|
@ -265,6 +267,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
|||
}
|
||||
|
||||
if (completion.showSuggestions) {
|
||||
if (completion.suggestions.length > 1) {
|
||||
if (key.name === 'up') {
|
||||
completion.navigateUp();
|
||||
return;
|
||||
|
@ -273,6 +276,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
|||
completion.navigateDown();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (key.name === 'tab' || (key.name === 'return' && !key.ctrl)) {
|
||||
if (completion.suggestions.length > 0) {
|
||||
|
@ -286,7 +290,8 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
|||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
if (!shellModeActive) {
|
||||
if (key.ctrl && key.name === 'p') {
|
||||
inputHistory.navigateUp();
|
||||
|
@ -341,7 +346,6 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
|||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Newline insertion
|
||||
if (key.name === 'return' && (key.ctrl || key.meta || key.paste)) {
|
||||
|
|
Loading…
Reference in New Issue