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

Feature Request - Add Line Numbers to Code Box #1312

Open
dwillis77 opened this issue Feb 21, 2024 · 0 comments
Open

Feature Request - Add Line Numbers to Code Box #1312

dwillis77 opened this issue Feb 21, 2024 · 0 comments
Labels
feature-request New feature or request

Comments

@dwillis77
Copy link

Problem to Solve

With the current code box we do not have the option to add line numbers.

New Feature/Solution

Having the ability to add line numbers to a code box would be very helpful, especially for long snippets of code.

Alternative Solutions

The only real alternative solution is to either manually add the numbers yourself, or use text-to-table and then add numbers yourself, or use an alternative plugin such as NoteHighlight2016.

Additional Context

I think this feature would be most useful if we could additionally have an option to go with it that allows the user to specify whether to have one line of code per row in the underlying table, or have all code in one row in the table (and have line numbers in the same row in a column to the left, one line per number) (assuming that a table would be the method used to implement this). The reason for this option is because if we do one line number and one line of code per table row, then the code text wraps flawlessly if it needs to. If we put all code in a single row, and all line numbers in the same row one column to the left (one line per number), then what happens if the code text wraps is that the numbering will get messed up (this is currently an issue in the NoteHighlight2016 implementation of this feature).

The downside of enabling the one-row-per-line option is that copying the code text out of the table and into another application becomes more difficult - doing it w/ the native copy/paste will produce an extra newline between each line of code (although this is fairly easily remedied in apps like N++ using the "remove blank lines" option). However it seems the "copy as markdown" feature which is already implemented in OneMore has solved this problem, as I noticed - if I use "text to table" option currently to convert my code to a table with one line per row, and add line numbers in a column to the left, and then copy the code text out of the table using "copy as markdown" and paste into another app - it works flawlessly - no extra newlines, everything looks great.

So I think adding the line number feature with the option for the user to choose how to utilize it (single row or one-line-per-row) would be an excellent addition to the OneMore plugin and would be complemented well by its existing "copy as markdown" option. This would give us a numbered code box solution that handles line wrapping well and allows copying into external apps without issue - which is something that I don't think any other single OneNote plugin today can provide (today this can only be accomplished with a multitude of tools and some manual processes).

Let me end this by saying you have an amazing plugin here, and thank you very much in advance for considering this request!

@dwillis77 dwillis77 changed the title Add Line Numbers to Code Box Feature Request - Add Line Numbers to Code Box Feb 21, 2024
@stevencohn stevencohn added the feature-request New feature or request label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants