Community
    • Login

    Enhancement of the COLUMN EDITOR feature

    Scheduled Pinned Locked Moved General Discussion
    5 Posts 2 Posters 462 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • guy038G Offline
      guy038
      last edited by guy038

      Hello, All,

      In this topic, I would like to discuss about a possible improvement of the Column Editor feature… Let me explain :


      • Open any file

      • Put the caret, near the middle of current file, at any column N

      • Open the Column Editor feature

      • Choose the Text to Insert option or the Number to Insert option with pertinent parameters

      => Presently, the Column Editor feature will insert the text or the list of numbers, at column location N, 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 file
      
      

      Note 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 Insert option, containing the sentence This is a test

      +> After a click on the OK button, 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 test
      

      Now, let’s imagine a new parameter, part of the Column Editor dialog, named Total Insertion Number, filled with the number 15

      Then, it would add the text This is a test 15 times, 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 test
      

      In 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-mode selection or multi-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 100 number

      => 100 lines 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

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @guy038
        last edited by

        @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.

        1 Reply Last reply Reply Quote 0
        • guy038G Offline
          guy038
          last edited by guy038

          @alan-kilborn and All,

          First, sorry for my approximative translation !

          Now, regarding the enhancement of the Column Editor feature, 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, 100 lines would be appended with, either, the inserted text OR the list of numbers

          There is no mean to achieve such a goal with the present Column Editor feature ! Do you agree with my statement ?

          BR

          guy038

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA Offline
            Alan Kilborn @guy038
            last edited by

            @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. :-)

            1 Reply Last reply Reply Quote 0
            • guy038G Offline
              guy038
              last edited by

              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 743 empty lines exactly ( I chose that number as it’s a prime number ). Then :

              • Open a new tab Within N++

              • Hit the Enter key just once

              • Open the Replace dialog ( Ctrl + H )

              • Uncheck all box options

              • Check the Wrap around option ONLY

              • Select the Regular expression search mode

              • FIND \R

              • REPLACE $0$0

              • Click 10 times on the Replace All button

              => You should get a total of 1,025 lines ( Note that, after each replacement N, the number of lines increases to the value 2 × 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 ( so 743 + 1 )

              • Then, select to the very end of file with the Ctrl + Shift + End shortcut

              • And finally, hit the Delete key

              => It should remain the expected 743 lines !


              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 the Column Editor dialog, filled with the value 743, would have been more elegant and straightforward !

              Best Regards,

              guy038

              1 Reply Last reply Reply Quote 0

              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
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors