mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
feat(ui): add cursor to empty input prompt (#800)
This commit is contained in:
@@ -39,7 +39,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
|||||||
onClearScreen,
|
onClearScreen,
|
||||||
config,
|
config,
|
||||||
slashCommands,
|
slashCommands,
|
||||||
placeholder = 'Type your message or @path/to/file',
|
placeholder = ' Type your message or @path/to/file',
|
||||||
height = 10,
|
height = 10,
|
||||||
focus = true,
|
focus = true,
|
||||||
widthFraction,
|
widthFraction,
|
||||||
@@ -349,7 +349,14 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
|||||||
</Text>
|
</Text>
|
||||||
<Box flexGrow={1} flexDirection="column">
|
<Box flexGrow={1} flexDirection="column">
|
||||||
{buffer.text.length === 0 && placeholder ? (
|
{buffer.text.length === 0 && placeholder ? (
|
||||||
<Text color={Colors.Gray}>{placeholder}</Text>
|
focus ? (
|
||||||
|
<Text>
|
||||||
|
{chalk.inverse(placeholder.slice(0, 1))}
|
||||||
|
<Text color={Colors.Gray}>{placeholder.slice(1)}</Text>
|
||||||
|
</Text>
|
||||||
|
) : (
|
||||||
|
<Text color={Colors.Gray}>{placeholder}</Text>
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
linesToRender.map((lineText, visualIdxInRenderedSet) => {
|
linesToRender.map((lineText, visualIdxInRenderedSet) => {
|
||||||
const cursorVisualRow = cursorVisualRowAbsolute - scrollVisualRow;
|
const cursorVisualRow = cursorVisualRowAbsolute - scrollVisualRow;
|
||||||
|
|||||||
Reference in New Issue
Block a user