From 091d2d7e59448abcb151de79e4e46304a78f44c2 Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Sun, 22 Mar 2015 19:05:03 -0700 Subject: [PATCH] Allowed closing `Search Results` tab while search is in progress (#416). --- src/editor/findreplace.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/editor/findreplace.lua b/src/editor/findreplace.lua index 9fea0f6071..66d5320174 100644 --- a/src/editor/findreplace.lua +++ b/src/editor/findreplace.lua @@ -363,10 +363,14 @@ local function ProcInFiles(startdir,mask,subdirs,replace) -- give time to the UI to refresh if TimeGet() - start > 0.25 then ide:Yield() end - -- the IDE may be quitting after Yield, so check to make sure - -- the manager is still active + -- the IDE may be quitting after Yield or the tab may be closed, local ok, mgr = pcall(function() return ide:GetUIManager() end) - if not (ok and mgr:GetPane(searchpanel):IsShown()) then break end + -- so check to make sure the manager is still active + if not (ok and mgr:GetPane(searchpanel):IsShown()) + -- and check that the search results tab is still open + or not pcall(function() findReplace.reseditor:GetId() end) then + break + end end end end