summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/command.rs3
3 files changed, 3 insertions, 4 deletions
diff --git a/Cargo.lock b/Cargo.lock
index c4f9734..0488f71 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -295,7 +295,7 @@ dependencies = [
[[package]]
name = "dijo"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
"chrono",
"clap",
diff --git a/Cargo.toml b/Cargo.toml
index a0872ce..f4a31c9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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;