Re: [code] [textadept] Bug in find.lua? (was: Textadept 9 poll: Lua patterns or Regex?)

From: Mitchell <>
Date: Tue, 18 Oct 2016 22:50:36 -0400 (EDT)

Hi Giovanni,

On Fri, 14 Oct 2016, Giovanni Salmeri wrote:

>>> Not exactly, because s/^/x/ matches also empty lines, while s/^./x
>>> \0/ does not. One could write s/^.?/x\0/ but the problem would
>>> remain: for this to work in empty lines the replace command in
>>> Textadept should handle correctly zero-length captures.
>> Well unfortunately I do not know very much on this matter and cannot
>> offer much input. Perhaps you will have some sort of idea how to
>> proceed whenever you upgrade to Textadept 9 and try the new regex
>> library.
> While studying this tricky thing in Textadept 9, I stumbled upon
> what seems to me a little bug: with "aaaaaaaaaaaaa" the substitution
> s/a/b/g gives "babababababab". If I don't overlook something else, it
> is sufficient to change find.lua:152
> buffer:goto_pos(buffer:position_relative(pos, next and 1 or -1))
> with
> buffer:goto_pos(buffer:position_relative(pos, 0))
> Is it right? Thank you very much!

Thanks for the report. At first glance, I didn't think this was right (I
thought there might be the possibility of infinite loops), but it appears
correct. I need to test some more, so I don't think the fix will make it
into tonight's nightly build, but it should be in tomorrow's.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Tue 18 Oct 2016 - 22:50:36 EDT

This archive was generated by hypermail 2.2.0 : Wed 19 Oct 2016 - 06:42:04 EDT