[Geany] Regex replace weirdness

Lex Trotman elextr at xxxxx
Thu Sep 30 22:49:06 UTC 2010


On 30 September 2010 21:59, Nick Treleaven
<nick.treleaven at btinternet.com> wrote:
> On Thu, 30 Sep 2010 08:53:27 +1000
> Lex Trotman <elextr at gmail.com> wrote:
>
>> > Personally I think we shouldn't rematch a replaced start of line. I
>> > think this is counter intuitive. Is there a reason why the current
>> > behaviour is better?
>> >
>> > Anyway, the reason it works as it does was because that was easier to
>> > implement.
>>
>> Yes I understood that, as I said the alternative is to implement the
>> "find all and replacel" by proper substitute function which finds the
>> occurrences first then substitutes them.  I guess if you can do the
>> internal equivalent of the find all and mark command then just
>> substitute all marked.
>
> It might be possible to record the last start of line and prevent a
> rematch that way, avoiding caching.

My problem with any method that effectively changes the way the regex
works, is that it would have some more corner cases that will come up
later, after all its taken a while for this one to show up.


>
> BTW, you're right that there's more important things to do, but no harm
> in discussing improvements IMO.

Of course, as improvements that can be done at leisure, not bugs that
should be fixed ASAP.

Also, do you think you should be encouraging *me* to be suggesting
changes/improvements :-D

>
>> Actually it'd be nice to have an option for the
>> replacements to be highlighted so I could see the places it made
>> changes I didn't mean (does that often happen to you with change all??
>> :-)
>
> Could be useful, although maybe better if the replacements were listed
> in the Messages window so you don't have to scroll through the whole
> document.
>

The problem with listing them is that there is no context, some
erroneous changes will be obvious from the change, some won't, so I
will be wanting to go to the changed line so I'd expect that the
message would act like a compile error and allow click to go to the
line.

Cheers
Lex

> Regards,
> Nick
> _______________________________________________
> Geany mailing list
> Geany at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
>



More information about the Users mailing list