Navigation

    Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

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

    Help wanted · · · – – – · · ·
    find replace
    2
    3
    1113
    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.
    • David Baines
      David Baines last edited by David Baines

      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?

      Claudia Frank 1 Reply Last reply Reply Quote 0
      • Claudia Frank
        Claudia Frank @David Baines last edited by

        @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
        • David Baines
          David Baines last edited by

          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
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors