Merge pull request #1062 from Guldoman/PR_fix_logview_on_error

Fix opening `LogView` when reloading customizations
This commit is contained in:
Jefferson González 2022-07-05 18:00:56 -04:00 committed by GitHub
commit f611556f1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 8 deletions

View File

@ -68,15 +68,19 @@ local function reload_customizations()
local user_error = not core.load_user_directory() local user_error = not core.load_user_directory()
local project_error = not core.load_project_module() local project_error = not core.load_project_module()
if user_error or project_error then if user_error or project_error then
local LogView = require "core.logview" -- Use core.add_thread to delay opening the LogView, as opening
local rn = core.root_view.root_node -- it directly here disturbs the normal save operations.
for _,v in pairs(core.root_view.root_node:get_children()) do core.add_thread(function()
if v:is(LogView) then local LogView = require "core.logview"
rn:get_node_for_view(v):set_active_view(v) local rn = core.root_view.root_node
return for _,v in pairs(core.root_view.root_node:get_children()) do
if v:is(LogView) then
rn:get_node_for_view(v):set_active_view(v)
return
end
end end
end command.perform("core:open-log")
command.perform("core:open-log") end)
end end
end end