From ebf9b0ee99ac3903126524da32ac5a97310bef74 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Wed, 3 May 2023 17:19:08 +0200 Subject: [PATCH] added: notes list in command palette changed: do not bold grep result --- main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index bec9ca9..d37657a 100644 --- a/main.js +++ b/main.js @@ -1652,7 +1652,7 @@ function showgrepresult(grepresult) grepcontent.push("[[" + file + "]]"); for (var l in grepresult[file]) { - grepcontent.push("[" + l + "] " + grepresult[file][l].replace(new RegExp("(" + filter.value + ")", "gi"), "**$1**")); + grepcontent.push("[" + l + "] " + grepresult[file][l]); } grepcontent.push(""); } @@ -1706,7 +1706,9 @@ function commandpalette() searchinlist(commands .filter(c => !c.excludepalette) .map(c => c.hint) - .concat(snippets.map(s => "Insert snippet: " + s.hint))) + .concat(snippets.map(s => "Insert snippet: " + s.hint)) + .concat(list().map(t => "Open note: " + t)) + ) .then(hint => { var command = commands.find(c => c.hint == hint); @@ -1722,6 +1724,10 @@ function commandpalette() insert(snippet.insert, snippet.cursor); md.focus(); } + else if (hint.startsWith("Open note: ")) + { + loadnote(hint.replace("Open note: ", "")); + } } }); }