Skip to content

Commit

Permalink
Initial syntax highlight idea
Browse files Browse the repository at this point in the history
  • Loading branch information
lcagustini committed Oct 1, 2018
1 parent 49fc148 commit 72625ec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions langs/c/name
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C
16 changes: 16 additions & 0 deletions langs/c/syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
colors {
constant=0xFF0000
keyword=0x00FF00
preproc=0xFFFF00
type=0x0000FF
comment=0x00FFFF
other=0xFFFFFF
}

syntax {
constant=0.0;0;"*";'*';
keyword=for;if;while;else;switch;case;
preproc=#*;
type=int;float;long;short;double;void;char;
comment=//*;
}
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ fn main() {
},

Event::Window { win_event: event, .. } => {
println!["{:?}", event];
match event {
sdl2::event::WindowEvent::SizeChanged(_, _) | sdl2::event::WindowEvent::FocusGained |
sdl2::event::WindowEvent::Exposed | sdl2::event::WindowEvent::Moved(_, _)=> text.needs_update = true,
Expand Down Expand Up @@ -402,7 +401,7 @@ fn main() {
let texture = text.get_normal_char(n.unwrap(), &texture_creator);
let texture_info = texture.query();

canvas.copy(texture, None, Some(rect![x, w_height-f_s as u32, texture_info.width, texture_info.height])).unwrap();
canvas.copy(&texture, None, Some(rect![x, w_height-f_s as u32, texture_info.width, texture_info.height])).unwrap();

n = n_iter.next();

Expand Down

0 comments on commit 72625ec

Please sign in to comment.