notes
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
# 27.01.2026
|
||||||
|
|
||||||
|
- [ ] Test 1
|
||||||
|
- [ ] Test 2
|
||||||
|
|
||||||
|
# 28.01.2026
|
||||||
|
|
||||||
|
- [x] Test 1
|
||||||
|
- [ ] Test 2
|
||||||
|
- [ ] Test 3
|
||||||
|
- [x] Test 4
|
||||||
|
- [x] Test 5
|
||||||
|
|
||||||
|
# 2026-01-29
|
||||||
|
|
||||||
|
- [ ] Test 2
|
||||||
|
- [ ] Test 3
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ fn update_notes(notes_path: &Path) {
|
|||||||
linebuf.clear();
|
linebuf.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find duplicates
|
|
||||||
let mut todos_hashset: HashSet<&str> = HashSet::new();
|
let mut todos_hashset: HashSet<&str> = HashSet::new();
|
||||||
let split_lines = all_lines.rsplit("\n");
|
let split_lines = all_lines.rsplit("\n");
|
||||||
for (rev_idx, line) in split_lines.enumerate() {
|
for (rev_idx, line) in split_lines.enumerate() {
|
||||||
@@ -107,13 +106,8 @@ fn update_notes(notes_path: &Path) {
|
|||||||
let Some(todotext) = trimmed_str.get(6..) else {
|
let Some(todotext) = trimmed_str.get(6..) else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
if !todos_hashset.insert(todotext) {
|
if !todos_hashset.insert(todotext) || is_done(prefix) {
|
||||||
// false if dupl
|
|
||||||
lines_to_not_use.push(org_idx);
|
lines_to_not_use.push(org_idx);
|
||||||
} else {
|
|
||||||
if is_done(prefix) {
|
|
||||||
lines_to_not_use.push(org_idx);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,15 +130,14 @@ fn update_notes(notes_path: &Path) {
|
|||||||
|
|
||||||
let mut cur = lines_to_not_use.len() - 1;
|
let mut cur = lines_to_not_use.len() - 1;
|
||||||
for (idx, line) in all_lines.split("\n").enumerate() {
|
for (idx, line) in all_lines.split("\n").enumerate() {
|
||||||
if cur > 0 && lines_to_not_use.get(cur).unwrap() == &idx {
|
if lines_to_not_use.get(cur).unwrap() == &idx {
|
||||||
cur -= 1;
|
cur = cur.saturating_sub(1);
|
||||||
} else {
|
} else {
|
||||||
writeln!(linebuf, "{line}").unwrap_or_else(|e| panic!("{e}"));
|
writeln!(linebuf, "{line}").unwrap_or_else(|e| panic!("{e}"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
file.write_all(linebuf.as_bytes()).unwrap_or_else(|e| panic!("Maaan look out for these files. Error is: {e}"));
|
file.write_all(linebuf.as_bytes()).unwrap_or_else(|e| panic!("Maaan look out for these files. Error is: {e}"));
|
||||||
// dbg!(&linebuf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fn parse_patterns(notes_path: &Path, patterns_path: &Path) {
|
// fn parse_patterns(notes_path: &Path, patterns_path: &Path) {
|
||||||
|
|||||||
Reference in New Issue
Block a user