diff options
author | 2009-02-08 21:46:56 -0500 | |
---|---|---|
committer | 2009-02-08 21:46:56 -0500 | |
commit | 638b667398201d00989c055d90637ffce20bd1d3 (patch) | |
tree | ac5db3b8b051945a73e823d3bd777dd3418cd226 /core/ext/find.lua | |
parent | 19a09c7ea4a25b55fe5b0dcff33a4d40fc320b3b (diff) | |
download | textadept-638b667398201d00989c055d90637ffce20bd1d3.tar.gz textadept-638b667398201d00989c055d90637ffce20bd1d3.zip |
Do not do any find/replace when there is no find text.
Diffstat (limited to 'core/ext/find.lua')
-rw-r--r-- | core/ext/find.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/ext/find.lua b/core/ext/find.lua index 5aea4a35..cc7763d6 100644 --- a/core/ext/find.lua +++ b/core/ext/find.lua @@ -31,6 +31,7 @@ local escapes = { -- internally, and should not be set otherwise. -- @return position of the found text or -1 function find.find(text, next, flags, nowrap, wrapped) + if #text == 0 then return end local buffer = buffer local locale = textadept.locale local first_visible_line = buffer.first_visible_line -- for 'no results found' @@ -209,6 +210,7 @@ end -- @param flags The number mask identical to the one in 'find'. -- @see find.find function find.replace_all(ftext, rtext, flags) + if #ftext == 0 then return end local buffer = buffer if find.in_files then find.in_files = false end buffer:begin_undo_action() |