Skip to content

Commit

Permalink
Uses \ as tag separator
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Jul 20, 2018
1 parent c6edfd8 commit f70af6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ I tried to develop a clear interface without surprises, but you can easily
miss some feature:

* Double click on a feature, *everywhere*, open the edit panel;
* You can create sub-projects (or sub-contexts) by adding a dash. For example,
the project `+work-admin-automation` create this arborescence:
* You can create sub-projects (or sub-contexts) by adding a backslash. For
* example, the project `+work\admin\automation` create this arborescence:

```txt
work
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Task {
})
.into_owned();

let regex = ::regex::Regex::new(r"(?P<space>^|[\s])(?P<tag>[\+@][\w\-]+)").unwrap();
let regex = ::regex::Regex::new(r"(?P<space>^|[\s])(?P<tag>[\+@][\w\-\\]+)").unwrap();
subject = regex
.replace_all(&subject, "$space<b>$tag</b>")
.into_owned();
Expand Down
5 changes: 3 additions & 2 deletions src/widgets/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ impl Filter {
use gtk::ToValue;
use std::slice::SliceConcatExt;

let separator = '\\';
let (filter, (done, total)) = filter;
let progress = (done as f32 / total as f32) * 100.;
let f = filter.clone();

let mut levels: Vec<_> = f.split('-').collect();
let mut levels: Vec<_> = f.split(separator).collect();
let title = levels.pop().unwrap();

let parent = levels.join("-");
let parent = levels.join(&separator.to_string());

if !parent.is_empty() && root.get(&parent).is_none() {
self.append(root, (parent.clone(), (0, 0)));
Expand Down

0 comments on commit f70af6b

Please sign in to comment.