elvirbrk / NoteHighlight2016

Source code syntax highlighting for OneNote 2016 and OneNote for O365 . NoteHighlight 2013 port for OneNote 2016 (32-bit and 64-bit)
GNU General Public License v2.0
3.81k stars 393 forks source link

Feature Request: Remove line numbering when copying from One Note to the clipboard #69

Open krasian-zz opened 6 years ago

krasian-zz commented 6 years ago

When copying from One Note to the clipboard, I would like a way in which the line numbering does not get copied. This would be helpful as I normally paste into One Note with line numbering. When copying from One Note, I would like to copy the code without line numbering and be able to paste directly into Notepad or PowerShell ISE.

Perhaps this could be achieved by one of the following methods:

  1. using tables (line number in the first column of each row and the code for the line in the second column of each line number row)
  2. adding a button to the NoteHighlight ribbon bar that "Copy numbered code to clipboard" that will automatically delete the first 6 characters of each line.
elvirbrk commented 5 years ago

Not sure I understand the issue. Is it problem with line numbers added by this addin or code you are pasting already has line numbers? If you insert code in OneNote using this addin, then it's already using tables, and row numbers are in different column.

krasian-zz commented 5 years ago

When pasting into the popup box, you can check 'line number' to add line numbers. That part works great. The question is that when you copy from OneNote (after you had originally pasted from the addin into OneNote), it is helpful to have the line numbers removed before pasting into your editor.

As I use VI and PowerShell ISE often, they don't recognize columns and rows, so when I paste into PS ISE, I have to use another editor to remove the line numbers before pasting. VI can much easier remove the line numbers (actually, just deleting the first 6 characters from every line).