aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2018-05-07 12:27:34 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2018-05-07 12:27:34 -0400
commit0fc295c5893c5fdb83eb834be35cd26b39f20a0a (patch)
treea7e37b90fe170a1968ff84dee68002eb428e3056 /modules/textadept
parent8a145ff23a698dfbd5b1fc1f2f043f076837201d (diff)
downloadtextadept-0fc295c5893c5fdb83eb834be35cd26b39f20a0a.tar.gz
textadept-0fc295c5893c5fdb83eb834be35cd26b39f20a0a.zip
Fixed replace in selection infinite loop with empty matches.
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/find.lua1
1 files changed, 1 insertions, 0 deletions
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)