Enhancement of the COLUMN EDITOR feature
-
Hello, All,
In this topic, I would like to discuss about a possible improvement of the
Column Editorfeature… Let me explain :
-
Open any file
-
Put the caret, near the middle of current file, at any column
N -
Open the
Column Editorfeature -
Choose the
Text to Insertoption or theNumber to Insertoption with pertinent parameters
=> Presently, the
Column Editorfeature will insert the text or the list of numbers, at column locationN, throughout all the subsequent existing lines of the file.I propose an enhancement, with a new parameter, which would define the number of lines where the insertion of text or numbers would take place !
An example will make this clearer. Let’s suppose this INPUT text :
This is a simple example which shows how this new feature would act Througout all the lines of the current fileNote the two emmpty lines at the very end of file
-
Now, I put the caret right before the word
how, within the third line -
I choose the
Edit > Colum Editor...option -
I select, let’s say, the
Text to Insertoption, containing the sentenceThis is a test
+> After a click on the
OKbutton, the OUTPUT text is presently changed as :This is a simple example which shows This is a testhow this new feature would act Througout alThis is a testl the lines of the current This is a testfile This is a test This is a testNow, let’s imagine a new parameter, part of the
Column Editordialog, namedTotal Insertion Number, filled with the number15Then, it would add the text
This is a test15times, and would produce the following OUTPUT text :This is a simple example which shows This is a testhow this new feature would act Througout alThis is a testl the lines of the current This is a testfile This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a test This is a testIn other words :
-
It would act as usual as long as a current line exists in current file
-
It would add some lines, till the limit of
15, when no more line exists in current file
Of course, so as not to interfere with a possible
column-modeselection ormulti-selections, the use of this new capability would be allowed ONLY IF no initial selection exists, so ONLY IF a simgle caret is present, whatever its location in current file !
An other example could be :
-
You put the caret on the last empty line of a file
-
You open the
Column Editor -
For the new parameter, you choose, let’s say, the
100number
=>
100lines would be appended to the file with, either, the inserted text OR list of numbers
Do you think that this enhancement seems sensible ? I need your feedback before a possible pull request on GitHub !
Best Regards,
guy038
-
-
@guy038 said:
I need your feedback before a possible pull request on GitHub !
I think you mean before you “create an issue on GitHub”.
Feedback:
If I wanted to limit the lines for the common text insertion, I would create an empty column selection (what I call a “tall skinny caret”) over the lines to be affected, before invoking the column editor feature. If I do that, and then specify the insert text, what results is only on the lines touching the original selection.
-
@alan-kilborn and All,
First, sorry for my approximative translation !
Now, regarding the enhancement of the
Column Editorfeature, maybe I didn’t make myself clear !If you consider my second example of my previous post :
- You put the caret on the last empty line of a file
- You open the
Column Editor
- For the new parameter, you choose, let’s say, the number
100
=> Immediately,
100lines would be appended with, either, the inserted text OR the list of numbersThere is no mean to achieve such a goal with the present
Column Editorfeature ! Do you agree with my statement ?BR
guy038
-
@guy038 said:
There is no mean to achieve such a goal with the present Column Editor feature ! Do you agree with my statement ?
Yes, but I don’t know that functionality is lacking enough for someone to develop the new feature. Unless, say, you yourself are going to give implementation a try?
What I would do, instead, for your “second example” would be to manually create the line I want, on a new blank line at end-of-file and then just hold down my keycombo for duplicating a line until the line is copied as many times as I want (e.g. 100). Now, key repeat is likely to make me go over the amount needed slightly, but pressing the delete-line keycombo a few times is an easy repair. Very fast for me, rather than invoking the column editor and then fussing with its controls.
TL;DR: Your desired feature is okay, but not life-changing for me. :-)
-
Hi, @alan-kilborn and All,
Of course, I could use your method to achieve my goal but that is just the reason why I wanted this enhancement which should avoid any further operation !!
BTW, this idea occured to me while I was writing this other post :
https://community.notepad-plus-plus.org/topic/27511/surprising-regular-expression
In the meanwhile, I’ve found out a nice work-around to realize that goal ! Let’s imagine that you want to do a list of
743empty lines exactly ( I chose that number as it’s a prime number ). Then :-
Open a new tab Within N++
-
Hit the
Enterkey just once -
Open the Replace dialog (
Ctrl + H) -
Uncheck all box options
-
Check the
Wrap aroundoption ONLY -
Select the
Regular expressionsearch mode -
FIND
\R -
REPLACE
$0$0 -
Click 10 times on the
Replace Allbutton
=> You should get a total of
1,025lines ( Note that, after each replacementN, the number of lines increases to the value2 × N + 1)The trick is to repeat the process up to the first number which is greater than
743!-
Now, open the
Search > Go to...option (Ctrl + G) -
Search for the line
744( so743 + 1) -
Then, select to the very end of file with the
Ctrl + Shift + Endshortcut -
And finally, hit the
Deletekey
=> It should remain the expected
743lines !
I readily admit that all the different tasks of my work-around do not take long. However, I still think that a new field
Total insertion number, in theColumn Editordialog, filled with the value743, would have been more elegant and straightforward !Best Regards,
guy038
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login