Re: [code] [Textadept bug] Search & Replace all not working with Regex

From: Mitchell <m.att.foicica.com>
Date: Fri, 24 Mar 2017 13:40:58 -0400 (EDT)

Hi Ryan,

On Thu, 23 Mar 2017, Ryan P.C. McQuen wrote:

>> I wrote:
>
>> This is not quite a bug, but a feature. When text is selected, "Replace
>> All" acts as "replace all in selection". You need to de-select the "\n"
>> replaced, and then click "Replace All" to have all "\\n" replaced.
>
>> I suppose this behavior may be tweaked to check if selected text exactly
>> matches replacement text, and if so, go ahead and truly replace all. I'll
>> have a look into it. It may be tricky with backreferences in replacement
>> text though.
>
> OK, that makes sense. It is a bit disconcerting … it appears that
> Replace and Replace All have the same functionality in this context
> then, since Replace would also replace all occurrences within the
> selected text. Isn’t it more useful for the functionality to differ?

I agree, which is why I mentioned I'd look into tweaking the current
behavior.

> I misspoke a bit, the functionality is not identical, but it doesn’t
> seem to work as you say:
>
> If I select all the text and click Replace All, nothing happens. Is that
> intentional?

You found a bug. If the end of the selection is one character before the
end of the buffer, replace in selection works as expected. I will look
into a fix. Thanks for the report.

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Fri 24 Mar 2017 - 13:40:58 EDT

This archive was generated by hypermail 2.2.0 : Sat 25 Mar 2017 - 06:28:22 EDT