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.56k stars 179 forks source link

Modify Lines - with trim? #739

Open meteorquake opened 9 months ago

meteorquake commented 9 months ago

Alt-M is really easy to remember as a one-stop for modifying line starts/ends.

It would be useful if in appending what you type it could also do the related task of trimming n characters at the same time, with the trims obviously being carried out before the append. So something like

Trim    Prefix text to lines [   ]     [                           ]

Trim Append text to lines [   ]     [                           ]

or something equivalent. I don't think it would clutter the box since there's not much already there.

Cheers,

David

zufuliu commented 9 months ago

Not quite understand what you want, do you want to trim the typed prefix/suffix before prefixing/appending? can you give some examples?

meteorquake commented 9 months ago

If the line is abcdefghi then Left: trim 2 prefix PREFIX Right: trim 1 append SUFFIX would take it to PREFIXcdefghSUFFIX

so the box can be used for trims, prefix/suffix, or both - a line start/end adjustment box that can remove and add.

d

zufuliu commented 9 months ago

Seems not useful, currently PREFIXcdefghSUFFIX can be produced by: Alt + Z Alt + Z Alt + L then Alt + M

meteorquake commented 9 months ago

It's more about ease of memory :) remembering Alt-M is much easier otherwise I readily get such things mixed up (I'm one of those many people who gets left and right easily mixed up in terms of mapping the idea to word or key, apparently (quick google!) about 15% of the population have that issue). Currently to do Alt-Z it's easier to Alt-select a 0-wide selection and click delete but that doesn't work for the line ends. (Alt-M also has another large advantage, that you don't have to exactly encompass the start and ends of the lines in question, you can just swipe a selection across from mid line to midline and press Alt-M, whereas Alt-Z and Alt-L you need to exactly meet the ends.) David