aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/find.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-07-08 09:51:27 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-07-08 09:51:27 -0400
commit49a4d17618c2e3454c5f5fe37492a283c7c55cc2 (patch)
treecd5d82785a86c7ceb6aa8eb31c96ac6d232012cc /modules/textadept/find.lua
parentbda4a0b0c97107df86f68ce47f93949bae101065 (diff)
downloadtextadept-49a4d17618c2e3454c5f5fe37492a283c7c55cc2.tar.gz
textadept-49a4d17618c2e3454c5f5fe37492a283c7c55cc2.zip
Fixed bug in Lua Pattern "Replace All"; modules/textadept/find.lua
Do not match pattern anchors.
Diffstat (limited to 'modules/textadept/find.lua')
-rw-r--r--modules/textadept/find.lua2
1 files changed, 1 insertions, 1 deletions
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