ProgerXP / Notepad2e

Word highlighting, simultaneous editing, split views, math evaluation, un/grep, comment reformatting, UAC elevation, complete regexps (PCRE), Lua lexers, DPI awareness and more (XP+)
Other
375 stars 52 forks source link

View > St&arting Line Number... #342

Closed ProgerXP closed 2 years ago

ProgerXP commented 3 years ago

New command under Line Numbers. When called, prompts for a single numerical value (negative or positive), stored in the INI as usual. By default is 1. Affects status bar,gutter, Go To dialog, Modify Lines ($(L) and $(0L)), #340, and possibly other places where line numbers are accessed.

The prompt looks similar to Tab Settings (Ctrl+T) but smaller: label First line number: on the left, text input, OK button on the right with Cancel below it. The dialog's title is Starting Line Number (same as the menu command's text).

With this command it's possible to count line numbers from 0 or even from a negative offset. Useful when you have a list of things associated with sequential IDs; if the first thing's ID doesn't begin with 1 then you won't have to do math with a line number to get the ID.

cshnik commented 2 years ago

Done.

ProgerXP commented 2 years ago

Memo: Notepad2 pads $(0L) but we don't do this for negative numbers:

-1
00
01

And:

-10
-9

It's unclear if/how this should be addressed: - 1, -01 look a bit off.