From 0280ad6dacb68b5b7431b05855b0226454c3b34c Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 7 Mar 2013 21:17:33 -0500 Subject: No flags in replace_all(); modules/textadept/find.lua --- modules/textadept/find.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 2bd8f4cf..0d316105 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -323,17 +323,16 @@ events_connect(events.REPLACE, replace) -- This function ignores "Find in Files". -- @param ftext The text to find. -- @param rtext The text to replace found text with. --- @param flags The number mask identical to the one in `find_()`. -- @see find -local function replace_all(ftext, rtext, flags) - if #ftext == 0 then return end +local function replace_all(ftext, rtext) + if ftext == '' then return end if find.in_files then find.in_files = false end local buffer = buffer buffer:begin_undo_action() local count = 0 - if #buffer:get_sel_text() == 0 then + if buffer:get_sel_text() == '' then buffer:goto_pos(0) - while(find_(ftext, true, flags, true) ~= -1) do + while(find_(ftext, true, nil, true) ~= -1) do replace(rtext) count = count + 1 end @@ -344,13 +343,13 @@ local function replace_all(ftext, rtext, flags) local end_marker = buffer:marker_add(buffer:line_from_position(e + 1), MARK_FIND) buffer:goto_pos(s) - local pos = find_(ftext, true, flags, true) + local pos = find_(ftext, true, nil, true) while pos ~= -1 and pos < buffer:position_from_line( buffer:marker_line_from_handle(end_marker)) do replace(rtext) count = count + 1 - pos = find_(ftext, true, flags, true) + pos = find_(ftext, true, nil, true) end e = buffer:position_from_line(buffer:marker_line_from_handle(end_marker)) buffer:goto_pos(e) -- cgit v1.2.3