You are here: PSPad forum > English discussion forum > Re: BUG] endless replace

Re: BUG] endless replace

#1 BUG] endless replace

Posted by: nspp | Date: 2025-05-19 03:46 | IP: IP Logged

I want to add 2 empty lines to a file before each line starting with #---
I used the Search & Replace :
Search: ^#---
Replace: \n\n#---
-----------------------------------------
Option : "Regular expression",
Direction: "Entire Scope",
Scope : "Global"

If i process, the replacement goes into an endless loop.

As i add new lines, instead searching the next expression after the replaced text, it seems that the search stay in same line as the replaced text.
This cause an infinite loop.

If you tick Prompt user you can see the issue.

Options: Reply | Quote | Up ^


#2 Re: BUG] endless replace

Posted by: pspad | Date: 2025-05-19 04:29 | IP: IP Logged

Hello

If you want to create new line with replace, start on the end with backward direction, not global.
I know it's a bug, this is a workaround

Options: Reply | Quote | Up ^


#3 Re: BUG] endless replace

Posted by: nspp | Date: 2025-05-20 05:21 | IP: IP Logged

Many thanks for the tip.
I also succeeded adding a tab in the replaced string to alter startup matching.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2025 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR