EnlighterJS / Plugin.TinyMCE

:pencil: Official EnlighterJS Plugin for TinyMCE
https://tinymce.enlighterjs.org
Mozilla Public License 2.0
11 stars 6 forks source link

Feature Request — Order of options on the window #7

Closed ajtruckle closed 4 years ago

ajtruckle commented 4 years ago

Please see:

enlighter-options

It makes more sense to me to put the offset option before the list of highlighted lines. So:

This way is logical because the values for the highlighted lines are related to the value of the offset number.

AndiDittrich commented 4 years ago

Hi @ajtruckle

both values are related but technical independent - but i can change it because it makes more sense that both fields labeled with "line numbers" are displayed together

ajtruckle commented 4 years ago

They don't seem independant to me.

If I input 10, 20, 50 as the line numbers to highlight and then put 200 as the starting line number, won't they now be wrong? Should they then be 210,220, 250? Thus by specifying your offset first (if you need it) it will remind you that you start numbering relative to your offset and not necessarily 1.

AndiDittrich commented 4 years ago

all values interpreted as absolute values

in your example, the line 10,20,50 will be marked as highlighted but are technically not included and will be ignored

ajtruckle commented 4 years ago

Exactly. It might advantageous to have a note on the window stating that highlighted numbers are relative to the starting line number (offset).

AndiDittrich commented 4 years ago

they are absolute, not relative!

ajtruckle commented 4 years ago

I don't see that as the case.

If I paste 20 lines of code into a sample, and state the offset number begins 1001, my line numbers are 1001 - 1020. Technically I input 20 lines of code. The absolute values are 1 - 20 of the literal code set.

See what I mean? If I have pasted 20 lines of code, and said to highlight line 1010, it is not technically a literal line number, it is line 10 in my list of 20 lines which works out as 1010 due to the offset. I am sure we are just confusing each other here. :)

I am not complaining. It is just that in previous plugin he had it confusion. In his plugin I always had to highlight lines starting from 1, no matter what my offset was and it was confusing. Your numbers are literal (in that sense I get you).

Delete the issue if you like.

AndiDittrich commented 4 years ago

The absolute values are always related to the origin document and not to the html markup. EnlighterJS/Enlighter is designed for developers who want to copy+paste code directly from their IDE/editor into a post/page - in case we would use relative linenumbers it makes it more difficult to highlight the lines.

i understand that other syntax highlighters uses another approach but this is a design decision and is not subjected to change,- sry!

ajtruckle commented 4 years ago

For the record - I do not and never wanted it changed! No worries. :)