Skip to content

Commit ff76709

Browse files
committed
♻️ Improve config display to preserve instruction formatting
Replace truncated instruction display with line-by-line output The previous implementation condensed multi-line instructions into a single line and truncated them if they exceeded 150 characters. This change preserves the original formatting by: - Iterating through each line of the instructions - Printing each line individually with consistent styling - Maintaining all whitespace and line breaks from the original text This makes custom instructions more readable in the configuration display, especially for multi-line or structured instruction content.
1 parent f1d04aa commit ff76709

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/commands.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,10 @@ fn print_configuration(config: &Config) {
155155
println!("{}", "Custom Instructions".bright_blue().bold().underline());
156156
println!();
157157

158-
// Split instructions into multiple lines if needed for display
159-
let formatted_instructions = config.instructions.replace('\n', " ");
160-
161-
// If instructions are long, truncate with ellipsis
162-
if formatted_instructions.len() > 150 {
163-
let truncated = formatted_instructions.chars().take(147).collect::<String>();
164-
println!(" {}...", truncated.bright_white().italic());
165-
} else {
166-
println!(" {}", formatted_instructions.bright_white().italic());
167-
}
158+
// Display full instructions, preserving newlines
159+
config.instructions.lines().for_each(|line| {
160+
println!(" {}", line.bright_white().italic());
161+
});
168162

169163
println!();
170164
}

0 commit comments

Comments
 (0)