Merge branch 'main' into feat/colors

# Conflicts:
#	main.js
This commit is contained in:
quenousimporte 2023-09-25 14:17:35 +02:00
commit b93e8fd585
1 changed files with 16 additions and 5 deletions

21
main.js
View File

@ -956,12 +956,10 @@ function editsettings()
});
}
function changesetting()
function editsetting(name)
{
searchinlist(Object.keys(settings).map(name => name + ": " + settings[name]))
.then(setting =>
if (settings[name])
{
var name = setting.split(":").shift();
var value = settings[name];
var type = typeof value;
if (type != "undefined")
@ -979,6 +977,15 @@ function changesetting()
savesettings();
loadsettings();
}
}
}
function changesetting()
{
searchinlist(Object.keys(settings).map(name => name + ": " + settings[name]))
.then(setting =>
{
editsetting(setting.split(":").shift());
});
}
@ -1825,7 +1832,7 @@ function commandpalette()
.map(c => c.hint)
.concat(snippets.map(s => "Insert snippet: " + s.hint))
.concat(list().map(t => "Open note: " + t))
)
.concat(Object.keys(settings).map(s => "Edit setting: " + s)))
.then(hint =>
{
var command = commands.find(c => c.hint == hint);
@ -1845,6 +1852,10 @@ function commandpalette()
{
loadnote(hint.replace("Open note: ", ""));
}
else if (hint.startsWith("Edit setting: "))
{
editsetting(hint.replace("Edit setting: ", ""));
}
else
{
// if unknown command, create a new note