added: toggle spell check on f7

fixed: editor size when changing note
This commit is contained in:
quenousimporte 2023-01-27 15:46:25 +01:00
parent b8293768b5
commit 63079c992c
1 changed files with 15 additions and 1 deletions

16
main.js
View File

@ -285,6 +285,12 @@ var commands = [
action: save, action: save,
shortcut: "ctrl+s", shortcut: "ctrl+s",
allowunsaved: true allowunsaved: true
},
{
hint: "Toggle spell check",
action: togglespellcheck,
allowunsaved: true,
shortcut: "F7"
}]; }];
var snippets = [ var snippets = [
@ -319,6 +325,11 @@ var snippets = [
cursor: 0 cursor: 0
}]; }];
function togglespellcheck()
{
md.spellcheck = !md.spellcheck;
}
function showinfo() function showinfo()
{ {
var tags = gettags(currentnote); var tags = gettags(currentnote);
@ -1571,7 +1582,7 @@ function deletenote()
{ {
var trash = JSON.parse(window.localStorage.getItem("trash")) || []; var trash = JSON.parse(window.localStorage.getItem("trash")) || [];
trash.push(currentnote); trash.push(currentnote);
window.localStorage.setItem("trash", JSON.stringify(trash)); window.localStorage.setItem("trash", JSON.stringify(trash));
localdata = localdata.filter(n => n != currentnote); localdata = localdata.filter(n => n != currentnote);
@ -1824,7 +1835,10 @@ function bindfile(note)
preview.innerHTML = md2html(getnotecontent()); preview.innerHTML = md2html(getnotecontent());
resetfolds(); resetfolds();
md.style.height = "0px";
resize(); resize();
setpos(note.pos || 0); setpos(note.pos || 0);
// to improve... // to improve...