We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d497782 commit a28e006Copy full SHA for a28e006
crates/chat-cli/src/cli/chat/prompt.rs
@@ -402,6 +402,17 @@ impl Validator for MultiLineValidator {
402
fn validate(&self, os: &mut ValidationContext<'_>) -> rustyline::Result<ValidationResult> {
403
let input = os.input();
404
405
+ // Check for code block markers
406
+ if input.contains("```") {
407
+ // Count the number of ``` occurrences
408
+ let triple_backtick_count = input.matches("```").count();
409
+
410
+ // If we have an odd number of ```, we're in an incomplete code block
411
+ if triple_backtick_count % 2 == 1 {
412
+ return Ok(ValidationResult::Incomplete);
413
+ }
414
415
416
// Check for backslash continuation
417
if input.ends_with('\\') {
418
return Ok(ValidationResult::Incomplete);
0 commit comments