Re-add markdown streaming (#2029)
Wait for newlines, then render markdown on a line by line basis. Word wrap it for the current terminal size and then spit it out line by line into the UI. Also adds tests and fixes some UI regressions.
This commit is contained in:
@@ -35,8 +35,6 @@ pub(crate) enum ApprovalRequest {
|
||||
Exec {
|
||||
id: String,
|
||||
command: Vec<String>,
|
||||
#[allow(dead_code)]
|
||||
cwd: PathBuf,
|
||||
reason: Option<String>,
|
||||
},
|
||||
ApplyPatch {
|
||||
@@ -394,7 +392,6 @@ mod tests {
|
||||
use crossterm::event::KeyCode;
|
||||
use crossterm::event::KeyEvent;
|
||||
use crossterm::event::KeyModifiers;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::mpsc::channel;
|
||||
|
||||
#[test]
|
||||
@@ -404,7 +401,6 @@ mod tests {
|
||||
let req = ApprovalRequest::Exec {
|
||||
id: "1".to_string(),
|
||||
command: vec!["echo".to_string()],
|
||||
cwd: PathBuf::new(),
|
||||
reason: None,
|
||||
};
|
||||
let mut widget = UserApprovalWidget::new(req, tx);
|
||||
@@ -427,7 +423,6 @@ mod tests {
|
||||
let req = ApprovalRequest::Exec {
|
||||
id: "2".to_string(),
|
||||
command: vec!["echo".to_string()],
|
||||
cwd: PathBuf::new(),
|
||||
reason: None,
|
||||
};
|
||||
let mut widget = UserApprovalWidget::new(req, tx);
|
||||
|
||||
Reference in New Issue
Block a user