mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-11 22:00:41 -07:00
fix(core): resolve Windows line ending and path separation bugs across CLI (#21068)
This commit is contained in:
@@ -156,7 +156,7 @@ export function colorizeCode({
|
||||
try {
|
||||
// Render the HAST tree using the adapted theme
|
||||
// Apply the theme's default foreground color to the top-level Text element
|
||||
let lines = codeToHighlight.split('\n');
|
||||
let lines = codeToHighlight.split(/\r?\n/);
|
||||
const padWidth = String(lines.length).length; // Calculate padding width based on number of lines
|
||||
|
||||
let hiddenLinesCount = 0;
|
||||
@@ -225,7 +225,7 @@ export function colorizeCode({
|
||||
);
|
||||
// Fall back to plain text with default color on error
|
||||
// Also display line numbers in fallback
|
||||
const lines = codeToHighlight.split('\n');
|
||||
const lines = codeToHighlight.split(/\r?\n/);
|
||||
const padWidth = String(lines.length).length; // Calculate padding width based on number of lines
|
||||
const fallbackLines = lines.map((line, index) => (
|
||||
<Box key={index} minHeight={1}>
|
||||
|
||||
Reference in New Issue
Block a user