diff options
author | 2018-05-07 12:27:34 -0400 | |
---|---|---|
committer | 2018-05-07 12:27:34 -0400 | |
commit | 0fc295c5893c5fdb83eb834be35cd26b39f20a0a (patch) | |
tree | a7e37b90fe170a1968ff84dee68002eb428e3056 /modules/textadept | |
parent | 8a145ff23a698dfbd5b1fc1f2f043f076837201d (diff) | |
download | textadept-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.lua | 1 |
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) |