summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorliv <819880950@qq.com>2019-06-05 12:18:50 +0200
committerliv <819880950@qq.com>2019-06-05 12:18:50 +0200
commit62696f5819bd27489664bcb320e1e0b422e22e60 (patch)
tree934fb06689f6990255568b549dbeb5826e567704 /src
parent41170ce3411b2029d8906dcee16548f00d90ca24 (diff)
Remove highlighting and syntect
Diffstat (limited to 'src')
-rw-r--r--src/main.rs17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/main.rs b/src/main.rs
index 744888f..85c91b9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,14 +6,9 @@ use notify::DebouncedEvent;
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
use std::ffi::OsStr;
use std::fs;
-use std::io::BufRead;
use std::path::Path;
use std::sync::mpsc::channel;
use std::time::Duration;
-use syntect::easy::HighlightFile;
-use syntect::highlighting::{Style, ThemeSet};
-use syntect::parsing::SyntaxSet;
-use syntect::util::as_24_bit_terminal_escaped;
mod exercise;
mod run;
@@ -35,9 +30,6 @@ fn main() {
)
.get_matches();
- let ss = SyntaxSet::load_defaults_newlines();
- let ts = ThemeSet::load_defaults();
-
if None == matches.subcommand_name() {
println!();
println!(r#" welcome to... "#);
@@ -92,13 +84,8 @@ fn main() {
}
if matches.subcommand_name().is_none() {
- let mut highlighter =
- HighlightFile::new("default_out.md", &ss, &ts.themes["base16-eighties.dark"]).unwrap();
- for maybe_line in highlighter.reader.lines() {
- let line = maybe_line.unwrap();
- let regions: Vec<(Style, &str)> = highlighter.highlight_lines.highlight(&line, &ss);
- println!("{}", as_24_bit_terminal_escaped(&regions[..], true));
- }
+ let text = fs::read_to_string("default_out.txt").unwrap();
+ println!("{}", text);
}
println!("\x1b[0m");