diff options
author | Akshay <[email protected]> | 2020-07-22 17:38:50 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2020-07-22 17:38:50 +0100 |
commit | 5c910bc6cf193725575ef6146dcc8620e7a4a800 (patch) | |
tree | 600bfddbc38325b8920feea0b080f7456b5d0bd6 /src/app | |
parent | c421750d739f008902822a0254ccdff93556dca6 (diff) |
remove debug key binds, add :write command
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/impl_self.rs | 2 | ||||
-rw-r--r-- | src/app/impl_view.rs | 11 |
2 files changed, 1 insertions, 12 deletions
diff --git a/src/app/impl_self.rs b/src/app/impl_self.rs index 7eae853..cf0e97f 100644 --- a/src/app/impl_self.rs +++ b/src/app/impl_self.rs | |||
@@ -257,7 +257,7 @@ impl App { | |||
257 | self.message.set_message("help <command>|commands|keys") | 257 | self.message.set_message("help <command>|commands|keys") |
258 | } | 258 | } |
259 | } | 259 | } |
260 | Command::Quit => self.save_state(), | 260 | Command::Quit | Command::Write => self.save_state(), |
261 | Command::MonthNext => self.sift_forward(), | 261 | Command::MonthNext => self.sift_forward(), |
262 | Command::MonthPrev => self.sift_backward(), | 262 | Command::MonthPrev => self.sift_backward(), |
263 | Command::Blank => {} | 263 | Command::Blank => {} |
diff --git a/src/app/impl_view.rs b/src/app/impl_view.rs index b8c4589..0dfd20b 100644 --- a/src/app/impl_view.rs +++ b/src/app/impl_view.rs | |||
@@ -102,17 +102,6 @@ impl View for App { | |||
102 | self.set_focus(Absolute::Down); | 102 | self.set_focus(Absolute::Down); |
103 | return EventResult::Consumed(None); | 103 | return EventResult::Consumed(None); |
104 | } | 104 | } |
105 | Event::Char('w') => { | ||
106 | // helper bind to test write to file | ||
107 | let j = serde_json::to_string_pretty(&self.habits).unwrap(); | ||
108 | let mut file = File::create("foo.txt").unwrap(); | ||
109 | file.write_all(j.as_bytes()).unwrap(); | ||
110 | return EventResult::Consumed(None); | ||
111 | } | ||
112 | Event::Char('q') => { | ||
113 | self.save_state(); | ||
114 | return EventResult::with_cb(|s| s.quit()); | ||
115 | } | ||
116 | Event::Char('v') => { | 105 | Event::Char('v') => { |
117 | if self.habits.is_empty() { | 106 | if self.habits.is_empty() { |
118 | return EventResult::Consumed(None); | 107 | return EventResult::Consumed(None); |