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

From: Giovanni Salmeri <>
Date: Fri, 14 Oct 2016 08:51:38 +0200

> > 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))


buffer:goto_pos(buffer:position_relative(pos, 0))

Is it right? Thank you very much!

Giovanni Salmeri
You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Fri 14 Oct 2016 - 02:51:38 EDT

This archive was generated by hypermail 2.2.0 : Fri 14 Oct 2016 - 06:50:03 EDT