Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

134 feature code editor 2 #174

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
fixed chrome and webkit
KamyaPA committed Dec 6, 2023

Verified

This commit was signed with the committer’s verified signature.
igordanilcenko Igor Danilčenko
commit 1522446468a2a02428a2cc5f1f18222c2bc9221e
5 changes: 5 additions & 0 deletions src/lib/components/editor/Editor.svelte
Original file line number Diff line number Diff line change
@@ -39,6 +39,11 @@
linenr.appendChild(createLineNr(1));
return;
}
// Fixes line numbers in chrome and webkit
let substr = text.substring(text.length - 2);
if (substr == "\n\n") {
text = text.substring(0, text.length - 2) + '\n';
}
linenr.appendChild(createLineNr(1));
let lines = 1;
for (let i = 0; i <= text.length; i++)