From 891390d98ed1de06ce980e22ebaafa8c1a90b509 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Mon, 26 Oct 2020 23:30:11 +0100 Subject: [PATCH] When the current line is a todo, also use it for the next --- list-editor/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/list-editor/index.js b/list-editor/index.js index 6938fc1..964b538 100644 --- a/list-editor/index.js +++ b/list-editor/index.js @@ -431,6 +431,9 @@ function editor(root, inputData, options) { let next = cursor.get() + 1 < store.length() ? store.value(store.currentID(cursor.get() + 1)).indented : current let indent = next > current ? next : current let item = newListItem(indent) + if (currentValue.text.match(/^#\[\[TODO\]\]/)) { + item.text = '#[[TODO]] '; + } cursor.insertBelow(store, item) }