added: bullet snippet

added: sections in outline
This commit is contained in:
quenousimporte 2023-02-02 14:49:04 +01:00
parent e6d36b1fdc
commit bc94922a6b
1 changed files with 18 additions and 1 deletions

19
main.js
View File

@ -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