Closed Zignature closed 2 years ago
Good catch. Should we also increase pos.ch
by one?
In Microsoft Word, the Line and Column count both start at 1.
Feel free to open a PR :)
I'll catch pos.ch
too and open a PR :)
@Ionaru
We overlooked one thing. The Line:Column counter starts at 0:0
. It should be 1:1
.
Right now if you put your cursor in an empty document the Line:Column counter doesn't update to 1:1
. It updates to 1:2
after a character is added to the document.
Line ~2693: el.innerHTML = '0:0';
needs to be changed to el.innerHTML = '1:1';
You're right, I'll make a commit to fix that :)
Describe the bug The cursor position in the status bar (line:column) is wrong. The line number has an offset of -1.
To Reproduce Position the cursor anywhere in the document and check the line number in the status bar.
Expected behavior I expect the line number to be correct.
Screenshots Current:
Expected:
Version information
Solution line 2675 in easymde.js should be changed from
el.innerHTML = pos.line + ':' + pos.ch;
toel.innerHTML = pos.line + 1 + ':' + pos.ch;