added: command to remove completed tasks in todotxt
This commit is contained in:
parent
883d5de0bc
commit
d6a04cbcb8
13
main.js
13
main.js
|
@ -274,6 +274,11 @@ var commands = [
|
|||
{
|
||||
hint: "Show backlinks",
|
||||
action: backlinks
|
||||
},
|
||||
{
|
||||
hint: "Remove completed tasks",
|
||||
action: purgetodo,
|
||||
allowunsaved: true
|
||||
}];
|
||||
|
||||
var snippets = [
|
||||
|
@ -319,6 +324,14 @@ var snippets = [
|
|||
insert: "x " + (new Date).toISOString().substring(0, 10) + " "
|
||||
}];
|
||||
|
||||
function purgetodo()
|
||||
{
|
||||
if (currentistodo() && confirm("Remove completed tasks?"))
|
||||
{
|
||||
seteditorcontent(currentnote.content.replace(/\nx .*/g, ""));
|
||||
}
|
||||
}
|
||||
|
||||
function seteditorcontent(content, silent)
|
||||
{
|
||||
md.value = content;
|
||||
|
|
Loading…
Reference in New Issue