mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-11 13:51:10 -07:00
fix: expand paste placeholders in TextInput on submit (#19946)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -15,7 +15,7 @@ import { HalfLinePaddedBox } from './shared/HalfLinePaddedBox.js';
|
||||
import {
|
||||
type TextBuffer,
|
||||
logicalPosToOffset,
|
||||
PASTED_TEXT_PLACEHOLDER_REGEX,
|
||||
expandPastePlaceholders,
|
||||
getTransformUnderCursor,
|
||||
LARGE_PASTE_LINE_THRESHOLD,
|
||||
LARGE_PASTE_CHAR_THRESHOLD,
|
||||
@@ -346,10 +346,9 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
||||
(submittedValue: string) => {
|
||||
let processedValue = submittedValue;
|
||||
if (buffer.pastedContent) {
|
||||
// Replace placeholders like [Pasted Text: 6 lines] with actual content
|
||||
processedValue = processedValue.replace(
|
||||
PASTED_TEXT_PLACEHOLDER_REGEX,
|
||||
(match) => buffer.pastedContent[match] || match,
|
||||
processedValue = expandPastePlaceholders(
|
||||
processedValue,
|
||||
buffer.pastedContent,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user