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

Adding (configurable) Line Numbers to the Editor - every 10 lines #3482

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

MichaelBaiJie
Copy link

@MichaelBaiJie MichaelBaiJie commented May 18, 2022

  • 1. I documented all behaviour within the code as far as I could.
  • 2. This PR targets the develop branch and not the master branch.
  • 3. I have tested my changes extensively and paid extra attention to potential
    cross-platform issues (e./g. Cmd/Ctrl/Super key bindings)
  • 4. I ran the yarn lint and yarn test commands successfully
  • 5. I have added an entry to the CHANGELOG.md
  • [?] 6. I matched my code-style to the repository as far as possible
  • 7. I agree that my code will be published under the GNUP GPL v3 license
  • 8. In case I created new files, I added a header to them (see the existing
    files for examples)
  • 9. Before opening this PR, I ran git pull a last time to prevent any merge
    issues

Description

I added line numbers to the editor, they appear every 10 lines.

Changes

I added CodeMirror.lineNumbers to the cm options file, added some configurations to the gutter settings in Editor.less, and added a checkbox that toggles the numbers on/off

Additional information

One of the things I couldn't make nicer was the size of the gutter... so the lineNumbers gutter is 7em wide, to account for larger files. The line numbers also match the size of the line it is on, so header line numbers are larger. This is my first pull request, I'd love more guidance on how to improve the changes!

Tested on: <!-- Mac OS ->

@boring-cyborg
Copy link

boring-cyborg bot commented May 18, 2022

Thank you for opening your first PR! 🎉 We are very happy and would like to thank you very much for your contribution. If everything checks out, we'll make sure to review the PR as soon as possible and give feedback. In the meantime, to make the reviewing process as fast as possible, you can help us by checking the following things:

  • Did you follow the JSStandard coding style? - Did you comment everywhere where the necessity of a piece of code or the
    way it was implemented is not immediately obvious?
  • Did you attempt to stick as much to current coding habits as possible?
    (Note that this does not apply to pieces of code where we ourselves
    obviously violated good coding practices, which unfortunately happens
    sometimes. But please indicate this in your PR so that we know what you
    rectified!)

Furthermore, make sure that the linter does not complain, which will check your code on every new commit. If the linter task fails, make sure to run yarn lint locally and check the file eslint_report.htm which will tell you precisely what went wrong.
Stay sharp, and thanks again!

@stale
Copy link

stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale This label indicates that this issue might be automatically closed soon. label Aug 13, 2022
@stale stale bot removed the stale This label indicates that this issue might be automatically closed soon. label Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant