From 0fc295c5893c5fdb83eb834be35cd26b39f20a0a Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 7 May 2018 12:27:34 -0400 Subject: Fixed replace in selection infinite loop with empty matches. --- modules/textadept/find.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/textadept/find.lua') diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 2a9dd11d..7fab5429 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -351,6 +351,7 @@ local function replace_all(ftext, rtext) buffer:goto_pos(s) local pos = find(ftext, true, nil, true) while pos ~= -1 and (pos < buffer:indicator_end(INDIC_REPLACE, s) or EOF) do + if buffer.selection_empty then break end -- prevent infinite loops replace(rtext) count = count + 1 pos = find(ftext, true, nil, true) -- cgit v1.2.3