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