summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-07 11:38:44 +0800
committerGitHub <noreply@github.com>2023-03-07 11:38:44 +0800
commit1640456049cda9999bb27501af30e05e46b0360d (patch)
tree8cc1ad88bd233a5898bff0520fd933db41f1e0da /src/main.rs
parentc12ae0275108acbbb124a41ff936b441723ae625 (diff)
downloadaichat-1640456049cda9999bb27501af30e05e46b0360d.tar.gz
refactor: use syntect for highlight, abandon mdcat (#26)
* refactor: use syntect for highlight, abandon mdcat * split src/render.rs to sub modules. embed a default theme * simulate typing effect. * fix format
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 5cb94f5..8f7b1a2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -68,8 +68,8 @@ fn start_directive(client: ChatGptClient, config: SharedConfig, input: &str) ->
let output = client.send_message(input, prompt)?;
let output = output.trim();
if config.borrow().highlight && stdout().is_terminal() {
- let markdown_render = MarkdownRender::init()?;
- markdown_render.print(output)?;
+ let mut markdown_render = MarkdownRender::new();
+ markdown_render.render(output);
} else {
println!("{output}");
}