diff --git a/data/core/commands/findreplace.lua b/data/core/commands/findreplace.lua index 73a5ae07..7027f293 100644 --- a/data/core/commands/findreplace.lua +++ b/data/core/commands/findreplace.lua @@ -78,19 +78,22 @@ local function replace(kind, default, fn) core.command_view:set_text(default, true) core.status_view:show_tooltip(get_find_tooltip()) + core.command_view:set_hidden_suggestions() core.command_view:enter("Find To Replace " .. kind, function(old) core.command_view:set_text(old, true) local s = string.format("Replace %s %q With", kind, old) + core.command_view:set_hidden_suggestions() core.command_view:enter(s, function(new) + table.insert(core.previous_replace, new) local n = doc():replace(function(text) return fn(text, old, new) end) core.log("Replaced %d instance(s) of %s %q with %q", n, kind, old, new) - end, function() end, function() + end, function() return core.previous_replace end, function() core.status_view:remove_tooltip() end) - end, function() end, function() + end, function() return core.previous_find end, function() core.status_view:remove_tooltip() end) end diff --git a/data/core/init.lua b/data/core/init.lua index b1072b38..1978ce38 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -497,6 +497,7 @@ function core.init() core.redraw = true core.visited_files = {} core.previous_find = {} + core.previous_replace = {} core.restart_request = false core.quit_request = false core.replacements = whitespace_replacements()