@@ -6,14 +6,9 @@ use notify::DebouncedEvent;
6
6
use notify:: { RecommendedWatcher , RecursiveMode , Watcher } ;
7
7
use std:: ffi:: OsStr ;
8
8
use std:: fs;
9
- use std:: io:: BufRead ;
10
9
use std:: path:: Path ;
11
10
use std:: sync:: mpsc:: channel;
12
11
use std:: time:: Duration ;
13
- use syntect:: easy:: HighlightFile ;
14
- use syntect:: highlighting:: { Style , ThemeSet } ;
15
- use syntect:: parsing:: SyntaxSet ;
16
- use syntect:: util:: as_24_bit_terminal_escaped;
17
12
18
13
mod exercise;
19
14
mod run;
@@ -35,9 +30,6 @@ fn main() {
35
30
)
36
31
. get_matches ( ) ;
37
32
38
- let ss = SyntaxSet :: load_defaults_newlines ( ) ;
39
- let ts = ThemeSet :: load_defaults ( ) ;
40
-
41
33
if None == matches. subcommand_name ( ) {
42
34
println ! ( ) ;
43
35
println ! ( r#" welcome to... "# ) ;
@@ -92,13 +84,8 @@ fn main() {
92
84
}
93
85
94
86
if matches. subcommand_name ( ) . is_none ( ) {
95
- let mut highlighter =
96
- HighlightFile :: new ( "default_out.md" , & ss, & ts. themes [ "base16-eighties.dark" ] ) . unwrap ( ) ;
97
- for maybe_line in highlighter. reader . lines ( ) {
98
- let line = maybe_line. unwrap ( ) ;
99
- let regions: Vec < ( Style , & str ) > = highlighter. highlight_lines . highlight ( & line, & ss) ;
100
- println ! ( "{}" , as_24_bit_terminal_escaped( & regions[ ..] , true ) ) ;
101
- }
87
+ let text = fs:: read_to_string ( "default_out.txt" ) . unwrap ( ) ;
88
+ println ! ( "{}" , text) ;
102
89
}
103
90
104
91
println ! ( "\x1b [0m" ) ;
0 commit comments