You are here: PSPad forum > English discussion forum > Infinite loop while doing search and replace.

Infinite loop while doing search and replace.

#1 Infinite loop while doing search and replace.

Posted by: anilk3000 | Date: 2015-07-02 03:43 | IP: IP Logged

Hi All,
I stumbled on an issue with search and replace, which is causing infinite loop.

what i did was replace a "word" with "\nword" i.e. new line and same word.
expected was that all the occurrence of the word would be moved to next line instead this caused pspad to stuck in infinite loop.

Please suggest if someone have any Work Around for this.

Steps to reproduce:
1. insert text "Hello world"
2. Go to search and replace. turn on the regular expression check-box.
3. search for "world" replace with "\nworld"
4. Expected out put is
"Hello
world"

5. Actual is infinite loop.

Options: Reply | Quote | Up ^


#2 Re: Infinite loop while doing search and replace.

Posted by: vbr | Date: 2015-07-02 05:58 | IP: IP Logged

anilk3000:
Hi All,
I stumbled on an issue with search and replace, which is causing infinite loop.

what i did was replace a "word" with "\nword" i.e. new line and same word.
expected was that all the occurrence of the word would be moved to next line instead this caused pspad to stuck in infinite loop.

Please suggest if someone have any Work Around for this.

Steps to reproduce:
1. insert text "Hello world"
2. Go to search and replace. turn on the regular expression check-box.
3. search for "world" replace with "\nworld"
4. Expected out put is
"Hello
world"

5. Actual is infinite loop.

Hi,
I can confirm this buggy behaviour; there are some long standing problems with handling of newlines in search and replace, as the editor component actually works linewise. Some redesign of this feature is announced for some future version.
As for a current workaround, you can place the cursor at the end of the text and check the search direction "(o) Backwards" in the search dialog (using the same regexp pattern as above), it should work fine.

hth,
vbr

Options: Reply | Quote | Up ^


#3 Re: Infinite loop while doing search and replace.

Posted by: pspad | Date: 2015-07-02 06:02 | IP: IP Logged

I know boys, that search/replace is problematic and it's in the top of priorities.

Options: Reply | Quote | Up ^


#4 Re: Infinite loop while doing search and replace.

Posted by: Andreas | Date: 2015-07-02 12:00 | IP: IP Logged

anilk3000:
Please suggest if someone have any Work Around for this.

As a workaround you can use the plugin phreplace www.phdesign.com.au /phreplace/

Options: Reply | Quote | Up ^






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