diff options
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/command.rs | 3 |
3 files changed, 3 insertions, 4 deletions
@@ -295,7 +295,7 @@ dependencies = [ [[package]] name = "dijo" -version = "0.2.0" +version = "0.2.1" dependencies = [ "chrono", "clap", @@ -1,6 +1,6 @@ [package] name = "dijo" -version = "0.2.0" +version = "0.2.1" authors = ["Akshay <nerdy@peppe.rs>"] edition = "2018" description = "Scriptable, curses-based, digital habit tracker" diff --git a/src/command.rs b/src/command.rs index 38d48e9..0372065 100644 --- a/src/command.rs +++ b/src/command.rs @@ -61,8 +61,7 @@ pub fn open_command_window(s: &mut Cursive) { let completion = get_habit_completion(word, &habit_list); eprintln!("{:?} | {:?}", completion, contents); if let Some(c) = completion { - let cb = - view.set_content(format!("{}", contents) + c.strip_prefix(word).unwrap()); + let cb = view.set_content(format!("{}", contents) + &c[word.len()..]); return Some(EventResult::Consumed(Some(cb))); }; return None; |