From bc94922a6b792993079c373cb7e4866cdcee84e4 Mon Sep 17 00:00:00 2001 From: quenousimporte <76260127+quenousimporte@users.noreply.github.com> Date: Thu, 2 Feb 2023 14:49:04 +0100 Subject: [PATCH] added: bullet snippet added: sections in outline --- main.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 4b68439..8bf945f 100644 --- a/main.js +++ b/main.js @@ -17,7 +17,7 @@ var defaultsettings = }; //builtin -var markerslist = ["* ", "- ", " * ", " - ", ">> ", "> ", "=> ", "— ", "[ ] ", " "]; +var markerslist = ["* ", "- ", " * ", " - ", ">> ", "> ", "=> ", "— ", "[ ] ", " ", "• "]; var sectionmarks = ["---", "### ", "## ", "# ", "```"]; var codelanguages = ["xml", "js", "sql"]; @@ -356,6 +356,10 @@ var snippets = [ hint: "Dialog mark", insert: "— ", cursor: 0 +}, +{ + command: "/*", + insert: "• " }]; function ask(question) @@ -612,6 +616,19 @@ function showoutline() .replace(/#/g, "\xa0".repeat(4)); outline[line] = pos; } + else if (line == "---" && index != 0 && index != 3) + { + var next; + if (next = lines.find((current, i) => + { + return i > index && current != ""; + })) + { + var nbcar = 40; + next = next.length < nbcar ? next : next.substring(0, nbcar) + "..."; + outline["section L" + index + ": " + next] = pos; + } + } }); var keys = Object