From 4aab872ee1033df31827a35a1af2ee9f1ec2e2e7 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 11 Mar 2023 21:45:34 +0800 Subject: feat: add support for NO_COLOR (#67) --- src/render/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/render/mod.rs') 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 { + let (highlight, light_theme) = config.read().get_render_options(); let mut stream_handler = if highlight { let (tx, rx) = unbounded(); let abort_clone = abort.clone(); -- cgit v1.2.3