From ae07753242e0d8113ee208cc608faf9eadcaf404 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Sat, 16 Jul 2016 12:39:05 -0700 Subject: [PATCH] Add more debug printing --- src/term.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/term.rs b/src/term.rs index cf67a0e6..2a431168 100644 --- a/src/term.rs +++ b/src/term.rs @@ -32,6 +32,14 @@ macro_rules! debug_println { } } +macro_rules! debug_print { + ($($t:tt)*) => { + if cfg!(debug_assertions) { + print!($($t)*); + } + } +} + /// RAII type which manages grid state for render /// /// This manages the cursor during a render. The cursor location is inverted to @@ -453,6 +461,7 @@ impl ansi::Handler for Term { /// A character to be displayed #[inline] fn input(&mut self, c: char) { + debug_print!("{}", c); self.set_char(c); self.cursor.col += 1; } @@ -710,6 +719,7 @@ impl ansi::Handler for Term { /// set a terminal attribute #[inline] fn terminal_attribute(&mut self, attr: Attr) { + debug_println!("Set Attribute: {:?}", attr); match attr { Attr::DefaultForeground => { self.fg = DEFAULT_FG;