From 49a4d17618c2e3454c5f5fe37492a283c7c55cc2 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 8 Jul 2013 09:51:27 -0400 Subject: Fixed bug in Lua Pattern "Replace All"; modules/textadept/find.lua Do not match pattern anchors. --- modules/textadept/find.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/textadept/find.lua') diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index d7c34fd3..50b557ba 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -144,7 +144,7 @@ local function find_(text, next, flags, no_wrap, wrapped) local e = next and buffer.length or buffer.current_pos local caps = {buffer:text_range(s, e):find(next and patt or '^.*()'..patt)} M.captures = {table.unpack(caps, next and 3 or 4)} - if #caps > 0 then + if #caps > 0 and caps[2] >= caps[1] then pos, e = s + caps[next and 1 or 3] - 1, s + caps[2] buffer:set_sel(e, pos) end -- cgit v1.2.3