• Login
Community
  • Login

I would like to find and replace text once, without jumping to the next.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
search & replace
3 Posts 2 Posters 1.6k 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.
  • D
    David Baines
    last edited by David Baines Feb 2, 2018, 11:10 AM Feb 2, 2018, 11:10 AM

    When I create a couple of regular expressions for find and replace I would like to be able to do the find and replace operation only once and examine whether the regex has worked. However as soon as the change is made the next occurrence is found, and I can’t see the change that was made. I’ve taken to checking the line number, doing find and replace, then clicking elsewhere and using Ctrl+G to go back to the line that was changed.

    Is there any way to tell N++ to make a single replacement and not move to find the next one?

    C 1 Reply Last reply Feb 2, 2018, 11:57 AM Reply Quote 0
    • C
      Claudia Frank @David Baines
      last edited by Feb 2, 2018, 11:57 AM

      @David-Baines

      I don’t know of a switch/parameter which would prevent jumping to next text but
      maybe a quicker solution to your problem is to press ctrl+z (undo) and ctrl+y (redo)
      which results in having the cursor in the line of the last change.
      You could even record a macro and assign a shortcut to have only one shortcut to press.
      No worries about line numbers any more.

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 2
      • D
        David Baines
        last edited by Feb 2, 2018, 4:12 PM

        Thanks Claudia, that’s a great idea! I’d thought about using a macro but I wasn’t sure how to get a macro to ‘know’ the line number to jump back to. This works well.

        In case it is useful to anyone else I couldn’t record a macro using CTRL + Z and CTRL + Y and then save it. When I tried that the ‘Save Current Recorded Macro’ option was greyed out. However when I recorded a macro using the Edit Menu options Undo and Redo I was able to save it.

        So now I have Alt + Space as a shortcut to Jump to last edit which is useful.
        Many Thanks.

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