zufuliu / notepad4

Notepad4 (Notepad2⨯2, Notepad2++) is a light-weight Scintilla based text editor for Windows with syntax highlighting, code folding, auto-completion and API list for many programming languages and documents, bundled with file browser plugin matepath.
Other
2.6k stars 184 forks source link

Modify Lines : Skip Blank Lines #694

Closed meteorquake closed 1 year ago

meteorquake commented 1 year ago

The "Modify Lines" is very useful, with its prefixing and suffixing. Can I recommend a tickbox "Skip blank lines" as quite often you're only wanting to modify lines with content. I suppose this would be best as truly blank lines rather than also lines that are whitespace but someone may comment it would be good to include those too. Or it could be expressed as "Include Blank Lines" with it defaulted as ticked. I don't think it would burden the box's appearance. David

zufuliu commented 1 year ago

Added "Skip empty lines" option in 078a14a3691dabd9dbe2744af7577bc7c0bb12d1. skip empty line is easy to implement than skip blank line (line that is empty or contains only whitespaces). image

meteorquake commented 1 year ago

That looks great - and fantastic turnover time as ever (I will have to start a stopwatch next time!) :)

You may want to omit the trailing '.' on each option there as an aesthetic improvement? for example the Find dialog lacks them - maybe there are some other boxes similarly.

meteorquake commented 1 year ago

As an extra thought, it may be the 6 line number options there can be replaced by 2 boxes, one for the start number, one for the formatting, the reference to which then can always be $(N)

zufuliu commented 1 year ago

it may be the 6 line number options there can be replaced by 2 boxes

Use different letters would simplify parsing (after e0ecc0ff9dc0f1d5218becf5baa3a30c7202ac4e): https://github.com/zufuliu/notepad2/blob/e0ecc0ff9dc0f1d5218becf5baa3a30c7202ac4e/src/Edit.c#L2931-L2937