Page 1 of 1

Bug: Replacing line-breaks in selected text with RegExp

Posted: Thu Nov 06, 2003 12:07 pm
by trids
Using TextPad 4.6.2 / NT4

Select a few lines and start the Search & Replace dialog. Check Selected text on, and Regular expression too.

Find what = \n
Replace with = <a single space>

Click Replace All .. you end up with all the lines concatenated ok, but the problem is that only the text from the first of the original lines remains selected.

This causes havoc in macros that want to transform selected text with multiple executions of regular expression replacements. Instead, all the text should remain selected (please) .. just as it does when performing multiple replacements on selected text without removing line-breaks.

Posted: Thu Nov 06, 2003 3:17 pm
by s_reynisson
I'm using 4.7.2 on XP and it work's fine, the line breaks are replaced
and the selection holds.

Posted: Thu Nov 06, 2003 5:01 pm
by helios
The selection problem will occur if the last line selected isn't terminated. The work around is to terminate the line, and then select to the beginning of the following line.

We will fix this in the next maintenance release.

Posted: Fri Nov 07, 2003 6:43 am
by trids
Thanks for the prompt and helpful response, Stephen! While trying the workaround, I noticed something else that might be useful:

When I select lines from the margin (which also appears to include all the terminators) .. I get the problem. I guess you might call this line-select mode, where the cursor is a left-handed arrow.

It's only when painting in character-select mode that the workaround works: ie, when the cursor is the I-bar.

HTH