aboutsummaryrefslogtreecommitdiff
path: root/src/views.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-07-19 07:27:32 +0100
committerAkshay <[email protected]>2020-07-19 07:27:32 +0100
commit516116fbe429043303a354f4a71eba4badbd34fc (patch)
tree83a22908119b1b4c880957c63ed363da14d00c5f /src/views.rs
parent6bdf3fa422dc5d53def54ba2ad3e055737773440 (diff)
stop habits from consuming global events
Diffstat (limited to 'src/views.rs')
-rw-r--r--src/views.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/views.rs b/src/views.rs
index f06978c..e11b844 100644
--- a/src/views.rs
+++ b/src/views.rs
@@ -59,7 +59,14 @@ where
59 }, 59 },
60 ]), 60 ]),
61 |p| { 61 |p| {
62 p.print((0, 0), &format!(" {} ", self.name())); 62 p.print(
63 (0, 0),
64 &format!(
65 " {:.width$} ",
66 self.name(),
67 width = CONFIGURATION.view_width - 6
68 ),
69 );
63 }, 70 },
64 ); 71 );
65 72
@@ -136,7 +143,7 @@ where
136 fn on_event(&mut self, e: Event) -> EventResult { 143 fn on_event(&mut self, e: Event) -> EventResult {
137 let now = Local::now().naive_utc().date(); 144 let now = Local::now().naive_utc().date();
138 if self.is_auto() { 145 if self.is_auto() {
139 return EventResult::Consumed(None); 146 return EventResult::Ignored;
140 } 147 }
141 match e { 148 match e {
142 Event::Key(Key::Enter) | Event::Char('n') => { 149 Event::Key(Key::Enter) | Event::Char('n') => {