-
Notifications
You must be signed in to change notification settings - Fork 37
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
Show line numbers in file editor #916
Comments
Note: I have a proof of concept in #509, which I have a demo of (with updated CSS) at https://codepen.io/garrett/pen/qBGPzWZ ... where I just added some additional CSS I suggested in that discussion thread ( |
Hi @garrett I would like to explore this. From what I understand is that the changes should be made in editor.scss and editor.tsx. Is there any other information you could provide which can make the implementation simple? I am familiar with CSS and tailwind CSS but haven't explored SCSS much. |
@Mash707 you don't really need to know SCSS to work on this, you indeed need to edit the Look at the demo and try to understand what it does, most importantly test it out while resizing the browser. The resizing case will likely be the most difficult thing to handle. |
Thanks for the information @jelly . I'll begin with implementing the demo first and then moving forward we can test out the resizing part. |
I looked at the proof of concept from @garrett again, this seems to require a few per-requirsites:
The text is then iterated over and it is assumed that the word length of a JavaScript string is equal to the width when rendered. Creating a However this does not work well with internationalization I tried Japanese with a Japanese Lorem Ipsum and it looks wrong for example in Gedit this renders as: In your demo: The main take away here is that I quite like the approach with the line number height and line number container ie.
But this seems to not apply to Japanese and possibly other languages? |
Currently our editor lacks line numbers, ideally we add them via CSS.
The text was updated successfully, but these errors were encountered: