summaryrefslogtreecommitdiffstats
path: root/src/render/mod.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-11 21:45:34 +0800
committerGitHub <noreply@github.com>2023-03-11 21:45:34 +0800
commit4aab872ee1033df31827a35a1af2ee9f1ec2e2e7 (patch)
tree3e8f8dae818103fc551589d22b15c68068498921 /src/render/mod.rs
parentcfb6ce6958751da5e13683ea07f42a5dbc4eae01 (diff)
downloadaichat-4aab872ee1033df31827a35a1af2ee9f1ec2e2e7.tar.gz
feat: add support for NO_COLOR (#67)
Diffstat (limited to 'src/render/mod.rs')
-rw-r--r--src/render/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/render/mod.rs b/src/render/mod.rs
index d200087..5980302 100644
--- a/src/render/mod.rs
+++ b/src/render/mod.rs
@@ -7,6 +7,7 @@ pub use self::markdown::MarkdownRender;
use self::repl::repl_render_stream;
use crate::client::ChatGptClient;
+use crate::config::SharedConfig;
use crate::print_now;
use crate::repl::{ReplyStreamHandler, SharedAbortSignal};
@@ -18,12 +19,12 @@ use std::thread::spawn;
pub fn render_stream(
input: &str,
client: &ChatGptClient,
- highlight: bool,
- light_theme: bool,
+ config: SharedConfig,
repl: bool,
abort: SharedAbortSignal,
wg: WaitGroup,
) -> Result<String> {
+ let (highlight, light_theme) = config.read().get_render_options();
let mut stream_handler = if highlight {
let (tx, rx) = unbounded();
let abort_clone = abort.clone();