fixed: cursor pos in % when content is empty
This commit is contained in:
parent
6122e20e3d
commit
77e63d3113
7
main.js
7
main.js
|
@ -510,6 +510,11 @@ function formatsize(size)
|
||||||
return size.toFixed(2) + " " + unit;
|
return size.toFixed(2) + " " + unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pospercent()
|
||||||
|
{
|
||||||
|
return md.value.length > 0 ?(100 * md.selectionStart / md.value.length).toFixed(2) : 100;
|
||||||
|
}
|
||||||
|
|
||||||
function showinfo()
|
function showinfo()
|
||||||
{
|
{
|
||||||
var tags = gettags(currentnote);
|
var tags = gettags(currentnote);
|
||||||
|
@ -518,7 +523,7 @@ function showinfo()
|
||||||
"vault: " + currentvault,
|
"vault: " + currentvault,
|
||||||
"saved: " + saved,
|
"saved: " + saved,
|
||||||
"title: " + currentnote.title,
|
"title: " + currentnote.title,
|
||||||
"cursor position: " + md.selectionStart + " (" + (100 * md.selectionStart / md.value.length).toFixed(2) + "%)",
|
"cursor position: " + md.selectionStart + " (" + pospercent() + "%)",
|
||||||
(tags ? "tags: " + tags : ""),
|
(tags ? "tags: " + tags : ""),
|
||||||
"spell check: " + (md.spellcheck ? "en" : "dis") + "abled",
|
"spell check: " + (md.spellcheck ? "en" : "dis") + "abled",
|
||||||
"notes count: " + localdata.length,
|
"notes count: " + localdata.length,
|
||||||
|
|
Loading…
Reference in New Issue