Skip to content

Commit 7860f67

Browse files
committed
multiline hint added
1 parent a28e006 commit 7860f67

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/chat-cli/src/cli/chat/prompt.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,15 @@ impl ChatHinter {
353353
return None;
354354
}
355355

356+
// Check for unclosed triple backticks
357+
if line.contains("```") {
358+
let triple_backtick_count = line.matches("```").count();
359+
if triple_backtick_count % 2 == 1 {
360+
// We have an odd number of ```, meaning we're in multiline mode
361+
return Some("in multiline mode, waiting for closing backticks ```".to_string());
362+
}
363+
}
364+
356365
// If line starts with a slash, try to find a command hint
357366
if line.starts_with('/') {
358367
return self

0 commit comments

Comments
 (0)