mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-19 22:40:20 -07:00
fix(ui): preserve new line at the end of edit window (#27057)
This commit is contained in:
@@ -202,15 +202,19 @@ async function calculateFlexibleReplacement(
|
||||
const indentationMatch = firstLineInMatch.match(/^([ \t]*)/);
|
||||
const indentation = indentationMatch ? indentationMatch[1] : '';
|
||||
const newBlockWithIndent = applyIndentation(replaceLines, indentation);
|
||||
sourceLines.splice(
|
||||
i,
|
||||
searchLinesStripped.length,
|
||||
newBlockWithIndent.join('\n'),
|
||||
);
|
||||
i += replaceLines.length;
|
||||
} else {
|
||||
i++;
|
||||
|
||||
let replacementText = newBlockWithIndent.join('\n');
|
||||
if (
|
||||
new_string !== '' &&
|
||||
window[window.length - 1].endsWith('\n') &&
|
||||
!replacementText.endsWith('\n')
|
||||
) {
|
||||
replacementText += '\n';
|
||||
}
|
||||
|
||||
sourceLines.splice(i, searchLinesStripped.length, replacementText);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (flexibleOccurrences > 0) {
|
||||
|
||||
Reference in New Issue
Block a user