aboutsummaryrefslogtreecommitdiff
path: root/src/app/impl_view.rs
diff options
context:
space:
mode:
authornc <[email protected]>2020-08-06 04:56:06 +0100
committernc <[email protected]>2020-08-06 04:56:06 +0100
commit976ea0282d373c4d08187a78a7b46a09d66f7918 (patch)
tree6d613a1b59ca277a82c8a688ec029774d10f31d5 /src/app/impl_view.rs
parentee9be05579d87ca99f153d20995af3273385b564 (diff)
revert
Diffstat (limited to 'src/app/impl_view.rs')
-rw-r--r--src/app/impl_view.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/app/impl_view.rs b/src/app/impl_view.rs
index 1261208..892b00c 100644
--- a/src/app/impl_view.rs
+++ b/src/app/impl_view.rs
@@ -39,8 +39,8 @@ impl View for App {
39 printer.print(offset, &status.1); // right status 39 printer.print(offset, &status.1); // right status
40 40
41 offset = offset.map_x(|_| 0).map_y(|_| self.max_size().y - 1); 41 offset = offset.map_x(|_| 0).map_y(|_| self.max_size().y - 1);
42 printer.with_style(Color::from(self.message.read().unwrap().kind()), |p| { 42 printer.with_style(Color::from(self.message.kind()), |p| {
43 p.print(offset, self.message.read().unwrap().contents()) 43 p.print(offset, self.message.contents())
44 }); 44 });
45 } 45 }
46 46
@@ -85,7 +85,6 @@ impl View for App {
85 if self.habits.is_empty() { 85 if self.habits.is_empty() {
86 return EventResult::Ignored; 86 return EventResult::Ignored;
87 } 87 }
88 let m = self.message.clone();
89 match e { 88 match e {
90 Event::Key(Key::Right) | Event::Key(Key::Tab) | Event::Char('l') => { 89 Event::Key(Key::Right) | Event::Key(Key::Tab) | Event::Char('l') => {
91 self.set_focus(Absolute::Right); 90 self.set_focus(Absolute::Right);
@@ -162,12 +161,8 @@ impl View for App {
162 return EventResult::Consumed(None); 161 return EventResult::Consumed(None);
163 } 162 }
164 Event::CtrlChar('l') => { 163 Event::CtrlChar('l') => {
165 self.message.write().unwrap().clear(); 164 self.message.clear();
166 self.message.write().unwrap().set_kind(MessageKind::Info); 165 self.message.set_kind(MessageKind::Info);
167 return EventResult::Consumed(None);
168 }
169 Event::CtrlChar('c') => {
170 m.write().unwrap().set_message("Use the :q command to quit");
171 return EventResult::Consumed(None); 166 return EventResult::Consumed(None);
172 } 167 }
173 168