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

From: Giovanni Salmeri <g.salmeri.att.mondodomani.org>
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))

with

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

Is it right? Thank you very much!

-- 
Giovanni Salmeri
http://mondodomani.org/pers/salmeri/
-- 
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 14 Oct 2016 - 02:51:38 EDT

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