Community
    • Login

    multiple edits with keyboard

    Scheduled Pinned Locked Moved General Discussion
    6 Posts 3 Posters 769 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.
    • Nick KatN
      Nick Kat
      last edited by Nick Kat

      Hi
      Imagine the following scenario. A “-” sign should be inserted into some gaps of the text shown on the picture below
      You see, that those are same lines in different languages of the same dialogs, so whenever a “-” sing should be entered into German line two others must be inserted in French and English
      Now, I got to click each and every place with a mouse.
      I know that Alt+Shirt allows using the keyboard in order to move the multicursor down to the next line. Unfortunately, it only works with the place last selected. So, if I first select 3 gaps on a German line with the mouse and the use Alt+Shirt expecting all three cursor to be moved below it does not happen, instead the only last place is multiplied below
      Should it be the case, it would be possible to simplify editing of the text by recording a macro that would spare quite some time.
      Would someone suggest a workaround allowing to extend multicursor selection to the lines below?

      Nick KatN PeterJonesP 2 Replies Last reply Reply Quote 0
      • Nick KatN
        Nick Kat @Nick Kat
        last edited by

        @Nick-Kat notepad++_3OGEHyjSo7.png
        schreenshot below better represents the text being edited

        1 Reply Last reply Reply Quote 0
        • PeterJonesP
          PeterJones @Nick Kat
          last edited by PeterJones

          @Nick-Kat,

          First, I will say, with multi-select as complicated as you described, I am assuming you either have the Better MultiSelect Plugin, or you have Notepad++ v8.6 which natively has a drastically-improved multi-selection capability. Without one of those two, what you are describing is not likely possible.

          Now, I got to click each and every place with a mouse.

          I assume you mean Ctrl+Click, because a normal click would just move the cursor rather than add to a multi-select

          I know that Alt+Shirt allows using the keyboard in order to move the multicursor down to the next line. Unfortunately, it only works with the place last selected.

          Alt+Shift+Arrow actually extends a column selection down, it doesn’t just move the multi-cursor down.

          In fact, the Alt puts it into column mode, and even with Notepad++ v8.6, I cannot make a multi-selection with successive Ctrl+Click and then extend it into multiple simultaneous column mode using Alt+Shift+Arrow. (I haven’t used Better MultiSelect enough to know whether it can handle that or not)

          So if you really want to start with multi-select, and then extend into multiple columns, you should try the plugin, and if that doesn’t work, you might consider an alternative.

          If, however, you can get away with doing a multi-select, then typing the - , then just moving the multi-select down a line and typing another -, that will work just fine: do the multi-select using Ctrl+Click, then type the - , then down-arrow (no Shift or Alt necessary), then you can type another - if needed on this second line.

          Nick KatN 1 Reply Last reply Reply Quote 0
          • Nick KatN
            Nick Kat @PeterJones
            last edited by

            @PeterJones Thank you for your answer!
            On this page link text a way is described for getting a rectangular selection, but what would help here really is a way to get several rectangular selections at once. Probably, the plug-in does not provide it, because selections can easily overlap…
            Also, trying to figure out some other way to achieve it I found that macro screws multiple cursors
            To be specific
            To reproduce

            1. with Ctrl+mouse select 3 places
            2. click “record macro” (3 cursors are blinking)
            3. push “-” button
            4. stop macro recording
            5. with Ctrl+mouse select 3 other places
            6. push “replay macro”
              you only get 1 “-”
            mkupperM 1 Reply Last reply Reply Quote 0
            • mkupperM
              mkupper @Nick Kat
              last edited by mkupper

              @Nick-Kat, I believe you can do what you desire with a regular expression.

              I don’t know if you are using spaces or tabs to separate the groups and so account for either using:
              Search: (\t|\x20{3})(?=\u)
              Replace: \1-
              Replace all will insert the - at the front of every line in the groups. It will cause the text to shift to the right at times meaning the groups won’t be visually lined up.

              If the desire is to only insert the - in the first lines of the groups then try:
              Search: ^([0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9]+ --> [0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9]+\R.+?)(\t|\x20{3})(?=\u)
              Replace: \1\2-
              The first time you do a replace-all it will only fix the first group and so you will need to do replace-all a few times until the count of changes reaches zero.

              With both of these the search is looking for a prefix or leader immediately followed by a letter. The prefix/leader can either be three spaces in a row or a tab. I decided on three spaces as you may have two spaces in a row within your text.

              Nick KatN 1 Reply Last reply Reply Quote 1
              • Nick KatN
                Nick Kat @mkupper
                last edited by

                @mkupper thanks for the suggestion )
                Unfortunately, not every instance has to be replaced. Depends on whether the phrase is said by other personage

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors