[WIP] Improve line numbers feature & better carriage return compatibility
DONE:
- Fix line counting issue
- Disable line numbers selection
- Temporary disable line numbers background
- Force X and Y overflow when using line numbers
- Make line numbers bar scrollable
- Improve line breaks (use universal
\r\ninstead of\n
TODO:
- Try to fix #19
- Try to fix #22
- Static line numbers bar (now broken) - help needed
- Implement current line highlighting
- Look for breaking changes
Work in progress - do not merge 😅! Comments and suggestions welcome.
Awesome! 👏 Also, it will be cool to have something online to see how your changes work. Maybe in playground.
@antonmedv Sure, I'll make a demo later. Any ideas on good online playground? :)
I usually upload everything to my site.
So any news?
Any progress?
Static line numbers bar (now broken) - help needed
Line numbers were fixed in this commit.
Improve line breaks (use universal
\r\ninstead of\n)
I'm not savvy enough to know when Windows line endings are universally preferred over Unix line endings, but if Unix line endings are kept, then this regex can be simplified to:
code.split(/\n/).length + (code.endsWith('\n') ? 0 : 1)
Either way, it fixes the issue where line numbers aren't added to the end of the editor.
@antonmedv Here are before and after gif's. Observe the line numbers as new lines are added. The first gif was captured using the latest master branch and second gif was captured with the regex fix:

Any progress? Someone what to continue from this PR?